예제 #1
0
 def test_goals_satisfied(self):
     test_goal1 = Goal(target='target', value='value', count=1)
     test_goal2 = Goal(target='target2', value='value2', count=1)
     test_facta = Fact(trait='target', value='value')
     test_factb = Fact(trait='target2', value='value2')
     multi = Objective(id='123',
                       name='test',
                       goals=[test_goal1, test_goal2])
     assert multi.completed([test_facta]) is False
     assert multi.completed([test_facta, test_factb]) is True
예제 #2
0
 def test_goals_percent(self):
     test_goal1 = Goal(target='target', value='value', count=1)
     test_goal2 = Goal(target='target2', value='value2', count=1)
     test_fact = Fact(trait='target', value='value')
     multi = Objective(id='123',
                       name='test',
                       goals=[test_goal1, test_goal2])
     assert multi.completed([test_fact]) is False
     assert multi.percentage == 50