예제 #1
0
 def queue_must_exist(self):
     """Makes sure the queue exists."""
     rabbit = rpc.Rabbit()
     queue_name = "guestagent.%s" % instance_info.id
     count = rabbit.get_queue_items(queue_name)
     assert_is_not(count, None)
     assert_equal(count, 0)
 def queue_must_exist(self):
     """Makes sure the queue exists."""
     rabbit = rpc.Rabbit()
     queue_name = "guestagent.%s" % instance_info.id
     count = rabbit.get_queue_items(queue_name)
     assert_is_not(count, None)
     assert_equal(count, 0)
예제 #3
0
def session_logout():
    for s in create_sessions():
        s.is_authenticated = True
        old_session = s._rsession
        s.logout()

        assert_false(s.is_authenticated)
        old_session.close.assert_called_once_with()
        assert_is_not(s._rsession, old_session)
예제 #4
0
def session_logout():
    for s in create_sessions():
        s.is_authenticated = True
        old_session = s._rsession
        s.logout()

        assert_false(s.is_authenticated)
        old_session.close.assert_called_once_with()
        assert_is_not(s._rsession, old_session)
    def test_pagination(self, requested_limit, requested_marker,
                        expected_length, expected_marker, expected_last_item):
        instances = self.dbaas.instances.list(limit=requested_limit,
                                              marker=requested_marker)
        marker = instances.next

        self.print_list(instances)

        # Better get as many as we asked for.
        assert_equal(len(instances), expected_length)
        # The last one should be roughly this one in the list.
        assert_equal(instances[-1].id, expected_last_item)
        # Because limit < count, the marker must be something.
        if expected_marker:
            assert_is_not(marker, None)
            assert_equal(marker, expected_marker)
        else:
            assert_is_none(marker)
        self.assert_instances_sorted_by_ids(instances)
    def test_pagination(self, requested_limit, requested_marker,
                        expected_length, expected_marker, expected_last_item):
        instances = self.dbaas.instances.list(limit=requested_limit,
                                              marker=requested_marker)
        marker = instances.next

        self.print_list(instances)

        # Better get as many as we asked for.
        assert_equal(len(instances), expected_length)
        # The last one should be roughly this one in the list.
        assert_equal(instances[-1].id, expected_last_item)
        # Because limit < count, the marker must be something.
        if expected_marker:
            assert_is_not(marker, None)
            assert_equal(marker, expected_marker)
        else:
            assert_is_none(marker)
        self.assert_instances_sorted_by_ids(instances)
예제 #7
0
def testReadControlFile():
    with open(mount_point + "/.control/" + basename) as f:
        assert_is_not(f.read(), '')
        f.close()
예제 #8
0
 def test_is_not1(self):
     assert_is_not(None, 3)
예제 #9
0
 def test_is_not1(self):
     assert_is_not(None, 3)