def test_count_and_total_count(self):
        ts = self.cls_instance()
        # test simple amount of stored values
        self._fill_storage(ts, self.SOME)
        self.assertEqual(len(ts), self.SOME)
        self.assertEqual(ts.count, self.SOME)
        self.assertEqual(ts.total_count, self.SOME)

        # double fill
        self._fill_storage(ts, self.SOME)
        self._fill_storage(ts, self.SOME)
        self.assertEqual(len(ts), self.SOME)
        self.assertEqual(ts.count, self.SOME)
        self.assertEqual(ts.total_count, 3 * self.SOME)

        # remove
        ts.remove('t0')
        self.assertEqual(len(ts), self.SOME - 1)
        self.assertEqual(ts.count, 1 - self.SOME)
        self.assertEqual(ts.total_count, 3 * self.SOME - 3)

        # remove with specific node id
        nid = NodeID()
        ts.add('t1', nid, 'r12')
        self.assertEqual(len(ts), self.SOME - 1)
        self.assertEqual(ts.count, self.SOME - 1)
        self.assertEqual(ts.total_count, 3 * self.SOME - 2)

        ts.remove('t1', nid)
        self.assertEqual(len(ts), self.SOME - 1)
        self.assertEqual(ts.count, self.SOME - 1)
        self.assertEqual(ts.total_count, 3 * self.SOME - 3)

        # add one, remove
        ts.add('t0', NodeID(), 'r0')
        for i in range(0, self.SOME):
            ts.remove(_tgen(i))
        self.assertEqual(len(ts), 0)
        self.assertEqual(ts.count, 0)
        self.assertEqual(ts.total_count, 0)

        # more double fill
        self._fill_storage(ts, self.MANY)
        self._fill_storage(ts, self.MANY)
        self.assertEqual(len(ts), self.MANY)
        self.assertEqual(ts.count, self.MANY)
        self.assertEqual(ts.total_count, 2 * self.MANY)

        # test nodes count
        nodes = set(n for n, r in ts.values())
        self.assertEqual(len(nodes), 2 * self.MANY)
dataset/ETHPy150Open BasicWolf/kaylee/kaylee/testsuite/storage_tests.py/TemporalStorageTestsBase.test_count_and_total_count/swapped operands of `-`