Exemplo n.º 1
0
    def test_append_job(self):
        command = "a string"
        sut = MasterNodeInterface(command)

        sut.append_job("test", ["arg1", "arg2"])

        self.assertTrue(len(sut._jobs) == 1 , "append_job did not add a job"
                        " To the job list")

        self.assertTrue(isinstance(sut._jobs[0], ComputeJob) ,
                 "append_job did not add an object with the type ComputeJob to"
                 " the job list")
Exemplo n.º 2
0
    def test_append_job(self):
        command = "a string"
        sut = MasterNodeInterface(command)

        sut.append_job("test", ["arg1", "arg2"])

        self.assertTrue(len(sut._jobs) == 1 , "append_job did not add a job"
                        " To the job list")

        self.assertTrue(isinstance(sut._jobs[0], ComputeJob) ,
                 "append_job did not add an object with the type ComputeJob to"
                 " the job list")
Exemplo n.º 3
0
    def test__init__raise_called_with_command(self):
        command = "a string"
        sut = MasterNodeInterface(command)

        self.assertTrue(sut._command == command,
            "The constructor did not assign the command to the local variabale")

        self.assertTrue(hasattr(sut, '_jobs') and isinstance(sut._jobs, list),
            "The constructor did create a list data member called _list")
Exemplo n.º 4
0
 def test_on_succes_raise_exception(self):
     command = "a string"
     sut = MasterNodeInterface(command)
     # on_error by default returns 0, check return value.
     self.assertEqual(0, sut.on_succes())
Exemplo n.º 5
0
 def test_on_error_return_value(self):
     command = "a string"
     sut = MasterNodeInterface(command)
     # on_error by default returns 0, check return value.
     self.assertEqual(1, sut.on_error())
Exemplo n.º 6
0
 def test_on_failure_return_value(self):
     command = "a string"
     sut = MasterNodeInterface(command)
     # on_failure by default returns 1, check return value.
     self.assertEqual(-1, sut.on_failure())
Exemplo n.º 7
0
 def test_on_succes_raise_exception(self):
     command = "a string"
     sut = MasterNodeInterface(command)
     # on_error by default returns 0, check return value.
     self.assertEqual(0, sut.on_succes())
Exemplo n.º 8
0
 def test_on_error_return_value(self):
     command = "a string"
     sut = MasterNodeInterface(command)
     # on_error by default returns 0, check return value.
     self.assertEqual(1, sut.on_error())
Exemplo n.º 9
0
 def test_on_failure_return_value(self):
     command = "a string"
     sut = MasterNodeInterface(command)
     # on_failure by default returns 1, check return value.
     self.assertEqual(-1, sut.on_failure())