def test_is_not_a_file(self): """Tests if an element on filesystem is not a file """ self.assertFalse(is_file('/tmp', 'my_other_module.py')) os.mkdir('/tmp/my_directory') self.assertFalse(is_file('/tmp', 'my_directory')) os.rmdir('/tmp/my_directory')
def test_is_a_file(self): """Tests if element on filesystem is a file """ with open('/tmp/my_module.py', 'w') as module: module.write('I\'m a Python module') self.assertTrue(is_file('/tmp', 'my_module.py')) os.remove('/tmp/my_module.py')