Ejemplo n.º 1
0
class GmpCloneTargetCommandTestCase(unittest.TestCase):

    TARGET_ID = '00000000-0000-0000-0000-000000000000'

    def setUp(self):
        self.connection = MockConnection()
        self.gmp = Gmp(self.connection)

    def test_clone(self):
        self.gmp.clone_target(self.TARGET_ID)

        self.connection.send.has_been_called_with(
            '<create_target>'
            '<copy>{copy}</copy>'
            '</create_target>'.format(copy=self.TARGET_ID)
        )
Ejemplo n.º 2
0
class GmpCloneTargetCommandTestCase(unittest.TestCase):

    TARGET_ID = '00000000-0000-0000-0000-000000000000'

    def setUp(self):
        self.connection = MockConnection()
        self.gmp = Gmp(self.connection)

    def test_clone(self):
        self.gmp.clone_target(self.TARGET_ID)

        self.connection.send.has_been_called_with(
            '<create_target>'
            '<copy>{copy}</copy>'
            '</create_target>'.format(copy=self.TARGET_ID))

    def test_missing_id(self):
        with self.assertRaises(RequiredArgument):
            self.gmp.clone_target('')

        with self.assertRaises(RequiredArgument):
            self.gmp.clone_target(None)