예제 #1
0
    def test_get_negative_adjudication_relevancy_has_cache(self):
        """
        Test that a shallow copy of the cached list is returned if there is a
        cache.
        """
        iqrs = IqrSession()

        iqrs._ordered_neg = ['simulation', 'cache']
        actual = iqrs.get_negative_adjudication_relevancy()
        assert actual == ['simulation', 'cache']
        assert id(actual) != id(iqrs._ordered_neg)
예제 #2
0
    def test_adjudicate_cache_resetting_negative(self):
        """
        Test results view cache resetting functionality on adjudicating certain
        ways.
        """
        e = DescriptorMemoryElement('', 0).set_vector([0])

        iqrs = IqrSession()
        iqrs._ordered_pos = True
        iqrs._ordered_neg = True
        iqrs._ordered_non_adj = True

        # Check that adding a positive adjudication resets the positive and
        # non-adjudicated result caches.
        iqrs.adjudicate(new_negatives=[e])
        assert iqrs._ordered_pos is True  # NOT reset
        assert iqrs._ordered_neg is None  # reset
        assert iqrs._ordered_non_adj is None  # reset