Beispiel #1
0
 def test_move_file(self):
     src = self.get_random_file()
     dst = self.get_random_path()
     assert_true(os.path.exists(src))
     assert_false(os.path.exists(dst))
     move_file(src, dst)
     assert_false(os.path.exists(src))
     assert_true(os.path.exists(dst))
 def test_normalize_unicode_error(self):
     s = 'Was\x9f'
     val = osxcollector._normalize_val(s)
     T.assert_false(isinstance(val, unicode))
 def test_normalize_unicode_error(self):
     s = 'Was\x9f'
     val = osxcollector._normalize_val(s)
     T.assert_false(isinstance(val, unicode))
Beispiel #4
0
 def test_assert_false(self):
     assert_false(None)
     assert_false(0)
     assert_false(0.0)
     assert_false('')
     assert_false(())
     assert_false([])
     assert_false({})
Beispiel #5
0
 def test_has_uppercase(self):
     assert_true(has_uppercase('Foo'))
     assert_true(has_uppercase('foO'))
     assert_false(has_uppercase('foo'))
     assert_false(has_uppercase(''))
Beispiel #6
0
 def test_in_bash(self):
     os.environ['SHELL'] = '/bin/bash'
     assert_true(in_bash())
     os.environ['SHELL'] = '/usr/bin/zsh'
     assert_false(in_bash())
Beispiel #7
0
 def test_assert_false(self):
     assert_false(None)
     assert_false(0)
     assert_false(0)
     assert_false(0.0)
     assert_false('')
     assert_false(())
     assert_false([])
     assert_false({})
     assert_false((''))