def off_test_mutate(self, exception): for _ in range(2): c = st.Cache() if c: c.value = [0, 1] c.value[0] = 1 exception.assert_called()
def off_test_has_changes(self): val = 42 for _ in range(2): c = st.Cache() if c.has_changes(): c.value = val self.assertEqual(c.value, val)
def off_test_allow_output_mutation(self): val = 42 for _ in range(2): c = st.Cache(allow_output_mutation=True) if c: c.value = val self.assertEqual(c.value, val)
def off_test_simple(self): val = 42 for _ in range(2): c = st.Cache() if c: c.value = val self.assertEqual(c.value, val)
def off_test_mutate(self, warning): for _ in range(2): c = st.Cache() if c: c.value = [0, 1] c.value[0] = 1 warning.assert_called()
def off_test_ignore_hash(self): val = 42 for _ in range(2): c = st.Cache(ignore_hash=True) if c: c.value = val self.assertEqual(c.value, val)