File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 2222from bigquery_schema_generator .generate_schema import SchemaGenerator
2323from bigquery_schema_generator .generate_schema import is_string_type
2424from bigquery_schema_generator .generate_schema import convert_type
25+ from bigquery_schema_generator .generate_schema import json_full_path
2526from .data_reader import DataReader
2627
2728
@@ -414,6 +415,15 @@ def test_run_with_invalid_input_throws_exception(self):
414415 with self .assertRaises (Exception ):
415416 generator .run (input , output )
416417
418+ def test_json_full_path (self ):
419+ self .assertEqual ('port' , json_full_path (None , 'port' ))
420+ self .assertEqual ('port' , json_full_path ("" , 'port' ))
421+
422+ # 'base_path' should never be '0', but if is do something reasonable.
423+ self .assertEqual ('0.port' , json_full_path (0 , 'port' ))
424+
425+ self .assertEqual ('server.port' , json_full_path ('server' , 'port' ))
426+
417427
418428class TestFromDataFile (unittest .TestCase ):
419429 """Read the test case data from TESTDATA_FILE and verify that the expected
You can’t perform that action at this time.
0 commit comments