コード例 #1
0
    def test_evaluation_context_path_error(self, path, error):
        # type: (Tuple[str, ...], str) -> None
        ec = EvaluationContext(self.table_context)
        ec.add_table_from_node(
            TableReference(('my_project', 'my_dataset', 'my_table')),
            EMPTY_NODE)
        ec.add_table_from_node(
            TableReference(('my_project', 'my_dataset', 'my_table2')),
            EMPTY_NODE)

        with self.assertRaisesRegexp(ValueError, error):
            ec.get_canonical_path(path)
コード例 #2
0
    def test_evaluation_context_path(self, path):
        # type: (Tuple[str, ...]) -> None
        ec = EvaluationContext(self.table_context)
        ec.add_table_from_node(
            TableReference(('my_project', 'my_dataset', 'my_table2')),
            EMPTY_NODE)

        self.assertEqual(ec.get_canonical_path(path), ('my_table2', 'b'))