Esempio n. 1
0
    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()
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    def off_test_simple(self):
        val = 42

        for _ in range(2):
            c = st.Cache()
            if c:
                c.value = val

            self.assertEqual(c.value, val)
Esempio n. 5
0
    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()
Esempio n. 6
0
    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)