コード例 #1
0
ファイル: test_override.py プロジェクト: eanylin/armada
    def test_find_document_type_valid(self):
        ovr = Override(self.base_documents)
        test_group = ovr.find_document_type('chart_group')
        self.assertEqual(test_group, const.DOCUMENT_GROUP)

        test_chart = ovr.find_document_type('chart')
        self.assertEqual(test_chart, const.DOCUMENT_CHART)

        test_manifest = ovr.find_document_type('manifest')
        self.assertEqual(test_manifest, const.DOCUMENT_MANIFEST)
コード例 #2
0
    def test_find_document_type_valid(self):
        with open(self.base_manifest) as f:
            documents = list(yaml.safe_load_all(f.read()))
            ovr = Override(documents)
            test_group = ovr.find_document_type('chart_group')
            self.assertEqual(test_group, const.DOCUMENT_GROUP)

            test_chart = ovr.find_document_type('chart')
            self.assertEqual(test_chart, const.DOCUMENT_CHART)

            test_manifest = ovr.find_document_type('manifest')
            self.assertEqual(test_manifest, const.DOCUMENT_MANIFEST)
コード例 #3
0
ファイル: test_override.py プロジェクト: nuaays/armada
 def test_find_document_type_invalid(self):
     with self.assertRaises(Exception):
         with open(self.base_manifest) as f:
             doc_obj = list(yaml.safe_load_all(f.read()))
             ovr = Override(doc_obj)
             ovr.find_document_type('charts')
コード例 #4
0
ファイル: test_override.py プロジェクト: eanylin/armada
 def test_find_document_type_invalid(self):
     with self.assertRaises(Exception):
         ovr = Override(self.base_documents)
         ovr.find_document_type('charts')