From f6d9837b079d550ad8588c60634cf5a798fc5253 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 14 Oct 2021 22:35:36 -0400 Subject: [PATCH] tests: Add test for legacy context interpretation --- test/context.t | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/context.t b/test/context.t index 79398ac5c..fc6509216 100755 --- a/test/context.t +++ b/test/context.t @@ -206,6 +206,16 @@ class ContextManagementTest(TestCase): self.assertEqual(len(list(filter(contains_work, out.splitlines()))), 1) self.assertEqual(len(list(filter(contains_home, out.splitlines()))), 1) + def test_context_list_legacy(self): + """Test the determination of legacy context definition.""" + self.t('config context.old project:Old', input='y\n') + self.t('context old') + code, out, err = self.t('context list') + + # Assert that "old" context has only the read component defined + self.assertRegex(out, r'read\s+project:Old\s+yes') + self.assertRegex(out, r'write\s+yes') + def test_context_initially_empty(self): """Test that no context is set initially.""" self.t('context define work project:Work', input='y\ny\n')