示例#1
0
    def restart_trond(self):
        old_pid = self.sandbox.get_trond_pid()
        self.sandbox.shutdown_trond()
        wait_on_proc_terminate(self.sandbox.get_trond_pid())

        self.sandbox.trond()
        assert_not_equal(old_pid, self.sandbox.get_trond_pid())
示例#2
0
 def test__eq__false(self):
     config = mock.Mock(agent=True, identities=['one', 'two'])
     second_config = mock.Mock(agent=True, identities=['two'])
     assert_not_equal(
         ssh.SSHAuthOptions.from_config(config),
         ssh.SSHAuthOptions.from_config(second_config),
     )
示例#3
0
    def test_open(self):
        # Not yet in cache
        fh_wrapper = self.manager.open(self.file1.name)
        assert_in(fh_wrapper.name, self.manager.cache)

        # Should now be in cache
        fh_wrapper2 = self.manager.open(self.file1.name)

        # Same wrapper
        assert_equal(fh_wrapper, fh_wrapper2)

        # Different wrapper
        assert_not_equal(fh_wrapper, self.manager.open(self.file2.name))
示例#4
0
    def test_open(self):
        # Not yet in cache
        fh_wrapper = self.manager.open(self.file1.name)
        assert_in(fh_wrapper.name, self.manager.cache)

        # Should now be in cache
        fh_wrapper2 = self.manager.open(self.file1.name)

        # Same wrapper
        assert_equal(fh_wrapper, fh_wrapper2)

        # Different wrapper
        assert_not_equal(fh_wrapper, self.manager.open(self.file2.name))
示例#5
0
 def test__eq__false(self):
     first = job.Job("jobname", 'scheduler', action_runner=mock.Mock())
     second = job.Job("jobname", 'scheduler', action_runner=mock.Mock())
     assert_not_equal(first, second)
示例#6
0
 def test__eq__false_ssh_options_changed(self):
     other_node = build_node()
     other_node.conch_options = mock.create_autospec(ssh.SSHAuthOptions)
     assert_not_equal(other_node, self.node)
示例#7
0
 def test__eq__false_pub_key_changed(self):
     other_node = build_node(pub_key='something')
     assert_not_equal(other_node, self.node)
示例#8
0
 def test__eq__false_config_changed(self):
     other_node = build_node(username='******')
     assert_not_equal(other_node, self.node)
示例#9
0
文件: job_test.py 项目: Yelp/Tron
 def test__eq__false(self):
     first = job.Job("jobname", 'scheduler', action_runner=mock.Mock())
     second = job.Job("jobname", 'scheduler', action_runner=mock.Mock())
     assert_not_equal(first, second)
示例#10
0
 def test__eq__false(self):
     first = actioncommand.SubprocessActionRunnerFactory('a', 'b')
     second = actioncommand.SubprocessActionRunnerFactory('a', 'c')
     assert_not_equal(first, second)
     assert_not_equal(first, None)
     assert_not_equal(first, actioncommand.NoActionRunnerFactory)
示例#11
0
 def test__ne__(self):
     other = mock.MagicMock(base='one/two', parts=['three'])
     assert_not_equal(self.path, other)
示例#12
0
 def test__eq__false(self):
     first = actioncommand.SubprocessActionRunnerFactory('a', 'b')
     second = actioncommand.SubprocessActionRunnerFactory('a', 'c')
     assert_not_equal(first, second)
     assert_not_equal(first, None)
     assert_not_equal(first, actioncommand.NoActionRunnerFactory)
示例#13
0
 def test__ne__(self):
     other = mock.MagicMock(base='one/two', parts=['three'])
     assert_not_equal(self.path, other)