Skip to content

Commit

Permalink
Explicitly specifying coverage tactician for tests; added a 'None' co…
Browse files Browse the repository at this point in the history
…ndition that might make issues later on...
  • Loading branch information
kadrlica committed Jul 6, 2018
1 parent ed781d4 commit 914f0bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion obztak/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def load_completed_fields(self, completed_fields=None):
self.completed_fields = self.completed_fields + new_fields
return self.completed_fields

def create_tactician(self,mode=None):
def create_tactician(self, mode=None):
return tactician_factory(cls=mode,mode=mode)

def select_field(self, date, mode=None):
Expand Down
2 changes: 2 additions & 0 deletions obztak/tactician.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from obztak.utils.date import datestring

CONDITIONS = odict([
(None, [0.0, 2.0]), #default
('great', [1.6, 2.0]),
('good', [0.0, 2.0]),
('complete',[0.0, 2.0]),
Expand Down Expand Up @@ -215,6 +216,7 @@ def select_fields(self):

class CoverageTactician(Tactician):
name = 'coverage'
mode = None

@property
def weight(self):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def test_schedule_field():
check_dict(value,out[index])

def test_schedule_chunk():
kwargs = dict(utc='2017-02-22T06:00:00',chunk=60,outfile='chunk_test.json',complete='None')
kwargs = dict(utc='2017-02-22T06:00:00',chunk=60,outfile='chunk_test.json',
complete='None',mode='coverage')
opts = make_options(kwargs)
cmd = 'env OBZTAK_SURVEY="maglites" schedule_chunk %s'%opts
call(cmd,shell=True)
Expand All @@ -37,7 +38,8 @@ def test_schedule_chunk():
check_dict(value,out[index])

def test_schedule_night():
kwargs = dict(nite='20160211',outfile='night_test/night_test.json',complete='None')
kwargs = dict(nite='20160211',outfile='night_test/night_test.json',complete='None',
mode='coverage')
opts = make_options(kwargs)
cmd = 'env OBZTAK_SURVEY="maglites" schedule_night %s'%opts
call(cmd,shell=True)
Expand Down

0 comments on commit 914f0bb

Please sign in to comment.