|
4 | 4 |
|
5 | 5 | class TestUtils(object): |
6 | 6 | def setup(self): |
7 | | - base = os.path.join(os.path.dirname(__file__), "../.."), |
8 | | - self.git = Git(base) |
9 | | -# self.git_bin_base = "%s --git-dir='%s'" % (Git.git_binary, base) |
10 | | - |
11 | | -# def test_it_escapes_single_quotes_with_shell_escape(self): |
12 | | -# assert_equal("\\\\'foo", shell_escape("'foo")) |
| 7 | + self.testdict = { |
| 8 | + "string": "42", |
| 9 | + "int": 42, |
| 10 | + "array": [ 42 ], |
| 11 | + } |
13 | 12 |
|
14 | 13 | def test_it_should_dashify(self): |
15 | 14 | assert_equal('this-is-my-argument', dashify('this_is_my_argument')) |
16 | 15 | assert_equal('foo', dashify('foo')) |
| 16 | + |
| 17 | + def test_pop_key_array(self): |
| 18 | + array = pop_key(self.testdict, "array") |
| 19 | + assert_equal( [ 42 ], array ) |
| 20 | + assert_equal( False, "array" in self.testdict ) |
| 21 | + |
| 22 | + def test_pop_key_string(self): |
| 23 | + stringValue = pop_key(self.testdict, "string") |
| 24 | + assert_equal( "42", stringValue ) |
| 25 | + assert_equal( False, "string" in self.testdict ) |
| 26 | + |
| 27 | + def test_pop_key_int(self): |
| 28 | + intValue = pop_key(self.testdict, "int") |
| 29 | + assert_equal( 42, intValue ) |
| 30 | + assert_equal( False, "int" in self.testdict ) |
0 commit comments