def test_Positive_createNode(self): node = bu.createNode('C:\\Users\\Alex', 'directory', 'parent') self.assertIsInstance(node, dict) self.assertEqual(node['name'], 'Alex') self.assertEqual(node['children'], []) self.assertEqual(node['path'], 'C:\\Users\\Alex') self.assertEqual(node['type'], 'directory') self.assertEqual(node['parent'], 'parent')
def test_Negative_createNode(self): with self.assertRaises(ValueError): node = bu.createNode('C:\\Fail', 'fail', 'fail') with self.assertRaises(ValueError): node = bu.createNode('C:\\Users','fail','fail')