示例#1
0
 def test_dataset_dest_and_table_dest_are_required_together_eventually(
         self, attr):
     task = BigQueryLoadFile(**{attr: "some-value"})
     with pytest.raises(ValueError) as exc:
         task.run(file=None)
     assert attr in str(exc.value)
     assert "must be provided" in str(exc.value)
示例#2
0
 def test_additional_kwargs_passed_upstream(self):
     task = BigQueryLoadFile(name="test-task",
                             checkpoint=True,
                             tags=["bob"])
     assert task.name == "test-task"
     assert task.checkpoint is True
     assert task.tags == {"bob"}
示例#3
0
 def test_initializes_with_nothing_and_sets_defaults(self):
     task = BigQueryLoadFile()
     assert task.project is None
     assert task.location == "US"
     assert task.dataset_id is None
     assert task.table is None
     assert task.file is None
     assert task.rewind is False
     assert task.num_retries == 6
     assert task.size is None
示例#4
0
 def test_initializes_attr_from_kwargs(self, attr):
     task = BigQueryLoadFile(**{attr: "my-value"})
     assert getattr(task, attr) == "my-value"