diff --git a/test/dom.t b/test/dom.t index 86250fc4..edba93cd 100755 --- a/test/dom.t +++ b/test/dom.t @@ -44,112 +44,112 @@ class TestDOM(TestCase): self.t = Timew() def test_dom_unrecognized(self): - """Test dom.NOPE which is unrecognized""" + """Test 'dom.NOPE' which is unrecognized""" code, out, err = self.t.runError("get dom.NOPE") self.assertIn("DOM reference 'dom.NOPE' is not valid.", err) def test_dom_tag_count_zero(self): - """Test dom.tag.count with zero tags""" + """Test 'dom.tag.count' with zero tags""" code, out, err = self.t("get dom.tag.count") self.assertEqual('0\n', out) def test_dom_tag_count_two(self): - """Test dom.tag.count with two tags""" + """Test 'dom.tag.count' with two tags""" self.t("start one two") code, out, err = self.t("get dom.tag.count") self.assertEqual('2\n', out) def test_dom_tag_N_none(self): - """Test dom.tag.N with no data""" + """Test 'dom.tag.N' with no data""" code, out, err = self.t.runError("get dom.tag.1") self.assertIn("DOM reference 'dom.tag.1' is not valid.", err) def test_dom_tag_N_two(self): - """Test dom.tag.N with two tags""" + """Test 'dom.tag.N' with two tags""" self.t("start one two") code, out, err = self.t("get dom.tag.2") self.assertEqual('two\n', out) def test_dom_active_inactive(self): - """Test dom.active without an active interval""" + """Test 'dom.active' without an active interval""" code, out, err = self.t("get dom.active") self.assertEqual('0\n', out) def test_dom_active_active(self): - """Test dom.active with an active interval""" + """Test 'dom.active' with an active interval""" self.t("start foo") code, out, err = self.t("get dom.active") self.assertEqual('1\n', out) def test_dom_active_tag_count_inactive(self): - """Test dom.active.tag.count with no active track""" + """Test 'dom.active.tag.count' with no active track""" code, out, err = self.t.runError("get dom.active.tag.count") self.assertIn("DOM reference 'dom.active.tag.count' is not valid.", err) def test_dom_active_tag_count_zero(self): - """Test dom.active.tag.count with zero tags""" + """Test 'dom.active.tag.count' with zero tags""" self.t("start") code, out, err = self.t("get dom.active.tag.count") self.assertEqual('0\n', out) def test_dom_active_tag_count_two(self): - """Test dom.active.tag.count with two tags""" + """Test 'dom.active.tag.count' with two tags""" self.t("start one two") code, out, err = self.t("get dom.active.tag.count") self.assertEqual('2\n', out) def test_dom_active_tag_N_none(self): - """Test dom.active.tag.N with no active track""" + """Test 'dom.active.tag.N' with no active track""" code, out, err = self.t.runError("get dom.active.tag.1") self.assertIn("DOM reference 'dom.active.tag.1' is not valid.", err) def test_dom_active_tag_N_zero(self): - """Test dom.active.tag.N with zero tags""" + """Test 'dom.active.tag.N' with zero tags""" self.t("start") code, out, err = self.t.runError("get dom.active.tag.1") self.assertIn("DOM reference 'dom.active.tag.1' is not valid.", err) def test_dom_active_tag_N_two(self): - """Test dom.active.tag.N with two tags""" + """Test 'dom.active.tag.N' with two tags""" self.t("start one two") code, out, err = self.t("get dom.active.tag.2") self.assertEqual('two\n', out) def test_dom_active_start_inactive(self): - """Test dom.active.start with no active track""" + """Test 'dom.active.start' with no active track""" code, out, err = self.t.runError("get dom.active.start") self.assertIn("DOM reference 'dom.active.start' is not valid.", err) def test_dom_active_start_active(self): - """Test dom.active.start with active track""" + """Test 'dom.active.start' with active track""" self.t("start one two") code, out, err = self.t("get dom.active.start") self.assertRegex(out, r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}') def test_dom_active_duration_inactive(self): - """Test dom.active.duration with no active track""" + """Test 'dom.active.duration' with no active track""" code, out, err = self.t.runError("get dom.active.duration") self.assertIn("DOM reference 'dom.active.duration' is not valid.", err) def test_dom_active_duration_active(self): - """Test dom.active.duration with active track""" + """Test 'dom.active.duration' with active track""" self.t("start one two") code, out, err = self.t("get dom.active.duration") self.assertRegex(out, r'PT\d+S') def test_dom_active_json_inactive(self): - """Test dom.active.json without an active interval""" + """Test 'dom.active.json' without an active interval""" code, out, err = self.t.runError("get dom.active.json") self.assertIn("DOM reference 'dom.active.json' is not valid.", err) def test_dom_active_json_active(self): - """Test dom.active.json with an active interval""" + """Test 'dom.active.json' with an active interval""" self.t("start foo") code, out, err = self.t("get dom.active.json") self.assertRegex(out, r'{"id":1,"start":"\d{8}T\d{6}Z","tags":\["foo"\]}') def test_dom_tracked_count_none(self): - """Test dom.active without an active interval""" + """Test 'dom.active' without an active interval""" code, out, err = self.t("get dom.tracked.count") self.assertEqual('0\n', out) @@ -160,7 +160,7 @@ class TestDOMTracked(TestCase): self.t = Timew() def test_dom_tracked_count_some(self): - """Test dom.tracked.count with an active interval""" + """Test 'dom.tracked.count' with an active interval""" self.t("track :yesterday one two") self.t("start") @@ -168,12 +168,12 @@ class TestDOMTracked(TestCase): self.assertEqual('2\n', out) def test_dom_tracked_tags_with_emtpy_database(self): - """Test dom.tracked.tags with empty database""" + """Test 'dom.tracked.tags' with empty database""" code, out, err = self.t("get dom.tracked.tags") self.assertEqual("\n", out) def test_dom_tracked_tags_with_no_tags(self): - """Test dom.tracked.tags with no tags""" + """Test 'dom.tracked.tags' with no tags""" now_utc = datetime.now().utcnow() four_hours_before_utc = now_utc - timedelta(hours=4) five_hours_before_utc = now_utc - timedelta(hours=5) @@ -184,7 +184,7 @@ class TestDOMTracked(TestCase): self.assertEqual("\n", out) def test_dom_tracked_tags_with_tags(self): - """Test dom.tracked.tags with tags""" + """Test 'dom.tracked.tags' with tags""" now_utc = datetime.now().utcnow() two_hours_before_utc = now_utc - timedelta(hours=2) three_hours_before_utc = now_utc - timedelta(hours=3) @@ -198,7 +198,7 @@ class TestDOMTracked(TestCase): self.assertEqual("bar foo\n", out) def test_dom_tracked_tags_with_quoted_tag(self): - """Test dom.tracked.tags with a tag with quotes""" + """Test 'dom.tracked.tags' with a tag with quotes""" now_utc = datetime.now().utcnow() two_hours_before_utc = now_utc - timedelta(hours=2) three_hours_before_utc = now_utc - timedelta(hours=3) @@ -212,7 +212,7 @@ class TestDOMTracked(TestCase): self.assertEqual("bar \"with quotes\"\n", out) def test_dom_tracked_tags_filtered_by_time(self): - """Test dom.tracked.tags with tags filtered by time""" + """Test 'dom.tracked.tags' with tags filtered by time""" now_utc = datetime.now().utcnow() one_hour_before_utc = now_utc - timedelta(hours=1) two_hours_before_utc = now_utc - timedelta(hours=2) @@ -228,7 +228,7 @@ class TestDOMTracked(TestCase): self.assertEqual("bar foo\n", out) def test_dom_tracked_tags_filtered_by_tag(self): - """Test dom.tracked.tags with tags filtered by tag""" + """Test 'dom.tracked.tags' with tags filtered by tag""" now_utc = datetime.now().utcnow() one_hour_before_utc = now_utc - timedelta(hours=1) two_hours_before_utc = now_utc - timedelta(hours=2) @@ -244,12 +244,12 @@ class TestDOMTracked(TestCase): self.assertEqual("baz foo\n", out) def test_dom_tracked_ids_with_emtpy_database(self): - """Test dom.tracked.ids with empty database""" + """Test 'dom.tracked.ids' with empty database""" code, out, err = self.t("get dom.tracked.tags") self.assertEqual("\n", out) def test_dom_tracked_ids(self): - """Test dom.tracked.ids""" + """Test 'dom.tracked.ids'""" now_utc = datetime.now().utcnow() four_hours_before_utc = now_utc - timedelta(hours=4) five_hours_before_utc = now_utc - timedelta(hours=5) @@ -260,7 +260,7 @@ class TestDOMTracked(TestCase): self.assertEqual("@1 \n", out) def test_dom_tracked_ids_filtered_by_time(self): - """Test dom.tracked.ids filtered by time""" + """Test 'dom.tracked.ids' filtered by time""" now_utc = datetime.now().utcnow() one_hour_before_utc = now_utc - timedelta(hours=1) two_hours_before_utc = now_utc - timedelta(hours=2) @@ -276,7 +276,7 @@ class TestDOMTracked(TestCase): self.assertEqual("@3 @2 \n", out) def test_dom_tracked_ids_filtered_by_tag(self): - """Test dom.tracked.ids filtered by tag""" + """Test 'dom.tracked.ids' filtered by tag""" now_utc = datetime.now().utcnow() one_hour_before_utc = now_utc - timedelta(hours=1) two_hours_before_utc = now_utc - timedelta(hours=2) @@ -292,7 +292,7 @@ class TestDOMTracked(TestCase): self.assertEqual("@3 @1 \n", out) def test_dom_tracked_N_tag_count_zero(self): - """Test dom.tracked.N.tag.count with zero tags""" + """Test 'dom.tracked.N.tag.count' with zero tags""" self.t("track :yesterday one two") self.t("start") @@ -300,7 +300,7 @@ class TestDOMTracked(TestCase): self.assertEqual('0\n', out) def test_dom_tracked_N_tag_count_two(self): - """Test dom.tracked.N.tag.count with two tags""" + """Test 'dom.tracked.N.tag.count' with two tags""" self.t("track :yesterday one two") self.t("start") @@ -308,7 +308,7 @@ class TestDOMTracked(TestCase): self.assertEqual('2\n', out) def test_dom_tracked_N_tag_N_none(self): - """Test dom.tracked.N.tag.N with no data""" + """Test 'dom.tracked.N.tag.N' with no data""" self.t("track :yesterday one two") self.t("start") @@ -316,7 +316,7 @@ class TestDOMTracked(TestCase): self.assertIn("DOM reference 'dom.tracked.1.tag.1' is not valid.", err) def test_dom_tracked_N_tag_N_two(self): - """Test dom.tracked.N.tag.N with two tags""" + """Test 'dom.tracked.N.tag.N' with two tags""" self.t("track :yesterday one two") self.t("start") @@ -324,7 +324,7 @@ class TestDOMTracked(TestCase): self.assertEqual('two\n', out) def test_dom_tracked_N_start_inactive(self): - """Test dom.tracked.N.start with no active track""" + """Test 'dom.tracked.N.start' with no active track""" self.t("track :yesterday one two") self.t("start") @@ -332,7 +332,7 @@ class TestDOMTracked(TestCase): self.assertIn("DOM reference 'dom.tracked.3.start' is not valid.", err) def test_dom_tracked_N_start_active(self): - """Test dom.tracked.N.start with active track""" + """Test 'dom.tracked.N.start' with active track""" self.t("track :yesterday one two") self.t("start") @@ -340,7 +340,7 @@ class TestDOMTracked(TestCase): self.assertRegex(out, r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}') def test_dom_tracked_N_end_invalid(self): - """Test dom.tracked.N.end with no active track""" + """Test 'dom.tracked.N.end' with no active track""" self.t("track :yesterday one two") self.t("start") @@ -348,7 +348,7 @@ class TestDOMTracked(TestCase): self.assertIn("DOM reference 'dom.tracked.3.end' is not valid.", err) def test_dom_tracked_N_end_inactive(self): - """Test dom.tracked.N.end with active track""" + """Test 'dom.tracked.N.end' with active track""" self.t("track :yesterday one two") self.t("start") @@ -356,7 +356,7 @@ class TestDOMTracked(TestCase): self.assertRegex(out, r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}') def test_dom_tracked_N_end_active(self): - """Test dom.tracked.N.end with active track""" + """Test 'dom.tracked.N.end' with active track""" self.t("track :yesterday one two") self.t("start") @@ -364,7 +364,7 @@ class TestDOMTracked(TestCase): self.assertEqual('\n', out) def test_dom_tracked_N_duration_inactive(self): - """Test dom.tracked.N.duration of closed track""" + """Test 'dom.tracked.N.duration' of closed track""" self.t("track :yesterday one two") self.t("start") @@ -372,7 +372,7 @@ class TestDOMTracked(TestCase): self.assertRegex(out, r'P1D') def test_dom_tracked_N_duration_active(self): - """Test dom.tracked.N.duration with open track""" + """Test 'dom.tracked.N.duration' with open track""" self.t("track :yesterday one two") self.t("start") @@ -380,7 +380,7 @@ class TestDOMTracked(TestCase): self.assertRegex(out, r'PT\d+S') def test_dom_tracked_N_json_inactive(self): - """Test dom.tracked.N.json of closed track""" + """Test 'dom.tracked.N.json' of closed track""" self.t("track :yesterday one two") self.t("start") @@ -388,7 +388,7 @@ class TestDOMTracked(TestCase): self.assertRegex(out, r'{"id":2,"start":"\d{8}T\d{6}Z","end":"\d{8}T\d{6}Z","tags":\["one","two"\]}') def test_dom_tracked_N_json_active(self): - """Test dom.tracked.N.json of open track""" + """Test 'dom.tracked.N.json' of open track""" self.t("track :yesterday one two") self.t("start") @@ -402,11 +402,11 @@ class TestDOMRC(TestCase): self.t = Timew() def test_dom_rc_missing(self): - """Test dom.rc.missing with no value""" + """Test 'dom.rc.missing' with no value""" code, out, err = self.t("get dom.rc.missing") def test_dom_rc_present(self): - """Test dom.rc.debug""" + """Test 'dom.rc.debug'""" code, out, err = self.t("get dom.rc.debug")