def test_create_empty_file(self): test_path = Utils.join_path(os.getcwd(), 'empty_file.txt') self.assertFalse(os.path.exists(test_path)) Utils.create_empty_file(test_path) self.assertTrue(os.path.exists(test_path)) self.assertEqual(os.path.getsize(test_path), 0) os.remove(test_path) self.assertFalse(os.path.exists(test_path))
def test_create_empty_file(self): test_path = Utils.join_path(os.getcwd(), 'empty_file.txt') self.assertFalse(os.path.exists(test_path)) Utils.create_empty_file(test_path) self.assertTrue(os.path.exists(test_path)) self.assertEqual(os.path.getsize(test_path), 0) os.remove(test_path) self.assertFalse(os.path.exists(test_path))
def test_get_file_content(self): test_path = Utils.join_path(os.getcwd(), 'empty_file.json') Utils.create_empty_file(test_path) Utils.write_to_file(test_path, 'Some content') file_content = Utils.get_file_content(test_path) self.assertEqual(file_content, 'Some content') os.remove(test_path) self.assertFalse(os.path.exists(test_path))
def test_get_file_content(self): test_path = Utils.join_path(os.getcwd(), 'empty_file.json') Utils.create_empty_file(test_path) Utils.write_to_file(test_path,'Some content') file_content = Utils.get_file_content(test_path) self.assertEqual(file_content, 'Some content') os.remove(test_path) self.assertFalse(os.path.exists(test_path))