def test_calculate_1(self): user = mockuser(0, (.25, .8)) t = STransaction(user, 1) assert t.calculate(.12) - .096 / .756 < 1e-10
def test_calculate_0(self): t = STransaction(mockuser(0, (.25, .8)), 0) assert t.calculate(.12) - .024 / .244 < 1e-10
def test_calculate_nocommit(self): t = STransaction(mockuser(1), 0) t.notify(mockuser(15, (0.1, 0.9))) assert t.calculate(.12) == .12