예제 #1
0
 def test_determine_contexts_direct(self):
     s = ContextsScript("cmdline.ContextsScript --contexts hst.pmap")
     s.contexts = contexts = s.determine_contexts()
     assert len(contexts) == 1, log.format(len(contexts), contexts)
     assert contexts[0] == "hst.pmap", log.format(len(contexts), contexts)
     mappings = sorted(list(set(s.get_context_mappings())))
     assert len(mappings) == 116, log.format(len(mappings), mappings)
예제 #2
0
 def test_determine_contexts_after(self):
     s = ContextsScript(
         "cmdline.ContextsScript --after-context hst-2016-01-01")
     contexts = s.determine_contexts()
     assert len(contexts) >= 108, log.format(len(contexts), contexts)
     assert contexts[0] == "hst_0379.pmap", log.format(
         len(contexts), contexts)
예제 #3
0
 def test_determine_contexts_upto(self):
     s = ContextsScript("cmdline.ContextsScript --up-to-context hst-2016-01-01")
     contexts = s.determine_contexts()
     assert len(contexts) == 195, log.format(len(contexts), contexts)
     assert contexts[0] == "hst.pmap", log.format(len(contexts), contexts)
예제 #4
0
 def test_determine_contexts_range(self):
     s = ContextsScript("cmdline.ContextsScript --range 1:7")
     contexts = s.determine_contexts()
     assert len(contexts) == 7, contexts
예제 #5
0
 def test_determine_contexts_last_n(self):
     s = ContextsScript("cmdline.ContextsScript --last 5")
     contexts = s.determine_contexts()
     assert len(contexts) == 5, contexts
예제 #6
0
 def test_determine_contexts_all(self):
     s = ContextsScript("cmdline.ContextsScript --all")
     contexts = s.determine_contexts()
     assert len(contexts) > 100, contexts