summary refs log tree commit diff stats
path: root/setup.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed references to doc/HACKING (for real)Dorien Snake2014-12-101-1/+1
|
* Fixed references to doc/HACKINGDorien Snake2014-12-101-1/+1
| | | | | | This patch replaces all references to `doc/HACKING` with `doc/HACKING.md`, to include the one in `setup.py` that was preventing a successful build. Some trailing whitespace was incidentally removed.
* fix references to README.mdhut2014-08-221-1/+1
|
* Changed email address in source codehut2013-08-081-1/+1
| | | | | Since lavabit.com ceased providing email services, I had to change my address from hut lavabit com to hut lepus uberspace de.
* added doc/config directory with symlinks to configshut2013-03-151-9/+4
|
* setup.py: added _findall functionhut2013-03-091-7/+6
|
* setup.py: create a /usr/share/doc/ranger directoryhut2013-03-091-1/+26
|
* setup.py: updated website URLhut2013-03-011-1/+1
|
* setup.py: removed fsobject packagehut2013-03-011-1/+0
|
* Merge branch 'master' into vcshut2013-02-221-1/+1
|\ | | | | | | | | Conflicts: ranger/gui/widgets/browsercolumn.py
| * updated rest of the copyright noticeshut2013-02-221-1/+1
| |
| * update email address (romanz@lavabit.com -> hut@lavabit.com)hut2013-02-221-1/+1
| |
* | Merge branch 'master' into vcshut2013-02-191-1/+1
|\|
| * setup.py: add doc/rifle.1 to man pageshut2013-02-181-1/+1
| |
* | setup.py: s/ranger.vcs/ranger.ext.vcs/hut2013-02-161-1/+1
| |
* | Merged code to manipulate version control systemsAbdo Roig-Maranges2013-02-121-1/+2
|/ | | | Supports git, hg and bzr.
* replaced tabs with 4 spaces in all python fileshut2013-02-101-23/+23
| | | | | | | | | PEP 8 (Style Guide for Python Code) suggests the use of 4 spaces: http://www.python.org/dev/peps/pep-0008/#indentation If you need to use tools like "git blame", you can use the -w option to ignore this commit entirely. Patches will continue to work if you substitute tabs with 4 spaces everywhere except in the Makefile.
* added scripts directory. rifle is now installed to /usr/bin/hut2012-08-041-1/+1
|
* setup.py: s/defaults/config/hut2012-08-021-3/+3
|
* setup.py: added entry for rifle.confhut2012-03-191-1/+2
|
* shorten all copyright messages for better readabilityhut2012-03-141-13/+1
|
* moved scripts/ranger to ranger/data/rangerhut2011-10-111-1/+1
| | | | | | This way, the user gets an extra copy of the executable in case the one in /usr/bin/ is lost. Also, we don't waste one directory at the root level for just one symlink.
* Updated copyright headershut2011-10-101-1/+1
| | | | As much as I hate this, it has to be done
* added defaults/rc.conf in setup.pyhut2011-09-301-1/+1
|
* Fixed setup.py (by removing ranger/help entry)hut2011-09-291-2/+1
|
* a little restructurationhut2010-10-021-2/+2
|
* Makefile, setup.py: Fixed `make doc`hut2010-09-111-23/+24
|
* added setup.py drafthut2010-06-181-0/+42
ec56fa56f2ef97227edf06de17c65000d9'>^
8dbe300d ^
a2726b6a ^
8dbe300d ^
81190251 ^
8dbe300d ^
81190251 ^
8dbe300d ^
8dbe300d ^

a2726b6a ^

8dbe300d ^
a2726b6a ^
8dbe300d ^
81190251 ^
8dbe300d ^
81190251 ^
8dbe300d ^
8dbe300d ^

a2726b6a ^

8dbe300d ^
a2726b6a ^
8dbe300d ^


81190251 ^

8dbe300d ^
a2726b6a ^
8dbe300d ^
98676613 ^

8dbe300d ^

a2726b6a ^

e089ffb1 ^
a2726b6a ^
e089ffb1 ^
4bd06a5d ^
e089ffb1 ^
eaf2901b ^
e089ffb1 ^
788fc48b ^
e089ffb1 ^
81190251 ^
e089ffb1 ^
e089ffb1 ^

a2726b6a ^

8dbe300d ^
a2726b6a ^
8dbe300d ^




81190251 ^

8dbe300d ^
a2726b6a ^
8dbe300d ^
a2726b6a ^
98676613 ^
8dbe300d ^

a2726b6a ^

8dbe300d ^
a2726b6a ^
8dbe300d ^


81190251 ^
8dbe300d ^
8dbe300d ^

a2726b6a ^

8dbe300d ^
a2726b6a ^
8dbe300d ^







8b4c7e93 ^
8dbe300d ^
81190251 ^
8dbe300d ^
8dbe300d ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

                   

                   

                   
                 

                      
 
                  
                       


                               

                              
                           
 

                          

                                                    
 
                                    
 
                                                      
 
                                                       
                        

 

                                                     
 
                                             
 
                                                      
 
                                                       
                        

 

                                                       
 
                                       
 
                                                      
 
                                                       
                        

 

                                                      
 
                                     
 
                                                      
 
                                                       
                        

 

                                      
 
                                                            


                                                                  

                                                       
 
                                               
                                                        

                       

 

                                                     
 
                                                            
 
               
                                            
                      
 
                                                               
 
                                                       
                        

 

                                            
 
                                             




                                                     

                                                       
 
                                               
                              
 
                       

 

                                                          
 
                                             


                                                  
                                                       
                        

 

                                              
 
                                     







                                                                 
                                           
 
                                                       
                        
 
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

#include "xmpp/xmpp.h"

#include "ui/ui.h"
#include "ui/stub_ui.h"

#include "config/preferences.h"

#include "command/cmd_defs.h"
#include "command/cmd_funcs.h"
#include "command/cmd_ac.h"

#define CMD_ALIAS "/alias"

void
cmd_alias_add_shows_usage_when_no_args(void** state)
{
    gchar* args[] = { "add", NULL };

    expect_string(cons_bad_cmd_usage, cmd, CMD_ALIAS);

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}

void
cmd_alias_add_shows_usage_when_no_value(void** state)
{
    gchar* args[] = { "add", "alias", NULL };

    expect_string(cons_bad_cmd_usage, cmd, CMD_ALIAS);

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}

void
cmd_alias_remove_shows_usage_when_no_args(void** state)
{
    gchar* args[] = { "remove", NULL };

    expect_string(cons_bad_cmd_usage, cmd, CMD_ALIAS);

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}

void
cmd_alias_show_usage_when_invalid_subcmd(void** state)
{
    gchar* args[] = { "blah", NULL };

    expect_string(cons_bad_cmd_usage, cmd, CMD_ALIAS);

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}

void
cmd_alias_add_adds_alias(void** state)
{
    gchar* args[] = { "add", "hc", "/help commands", NULL };

    expect_cons_show("Command alias added /hc -> /help commands");

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);

    char* returned_val = prefs_get_alias("hc");
    assert_string_equal("/help commands", returned_val);

    free(returned_val);
}

void
cmd_alias_add_shows_message_when_exists(void** state)
{
    gchar* args[] = { "add", "hc", "/help commands", NULL };

    cmd_init();
    prefs_add_alias("hc", "/help commands");
    cmd_ac_add("/hc");

    expect_cons_show("Command or alias '/hc' already exists.");

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}

void
cmd_alias_remove_removes_alias(void** state)
{
    gchar* args[] = { "remove", "hn", NULL };

    prefs_add_alias("hn", "/help navigation");

    expect_cons_show("Command alias removed -> /hn");

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);

    char* returned_val = prefs_get_alias("hn");
    assert_null(returned_val);

    free(returned_val);
}

void
cmd_alias_remove_shows_message_when_no_alias(void** state)
{
    gchar* args[] = { "remove", "hn", NULL };

    expect_cons_show("No such command alias /hn");

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}

void
cmd_alias_list_shows_all_aliases(void** state)
{
    gchar* args[] = { "list", NULL };

    prefs_add_alias("vy", "/vercheck on");
    prefs_add_alias("q", "/quit");
    prefs_add_alias("hn", "/help navigation");
    prefs_add_alias("hc", "/help commands");
    prefs_add_alias("vn", "/vercheck off");

    // write a custom checker to check the correct list is passed
    expect_any(cons_show_aliases, aliases);

    gboolean result = cmd_alias(NULL, CMD_ALIAS, args);
    assert_true(result);
}