def test_add_command(self): command_block = FileSystemServiceCommandBlock() command_block.add_command(DeleteCommand(path='/a/path')) et = command_block.get_etree() self.assertEqual(et.tag, 'commands') self.assertEqual(1, len(list(et))) self.assertEqual(0, len(et.keys())) self.assertIsNotNone(et.find('./{}'.format(DeleteCommand.command_name)))
def test_init(self): command_block = FileSystemServiceCommandBlock() et = command_block.get_etree() self.assertEqual(et.tag, 'commands') self.assertEqual(0, len(list(et))) self.assertEqual(0, len(et.keys()))