def test_check_for_partition(self, mock_get_partitions): mock_get_partitions.return_value = {('2018-01-01', )} hook = AwsGlueCatalogHook(region_name="us-east-1") self.assertTrue(hook.check_for_partition('db', 'tbl', 'expr')) mock_get_partitions.assert_called_once_with('db', 'tbl', 'expr', max_items=1)
def test_check_for_partition_false(self, mock_get_partitions): mock_get_partitions.return_value = set() hook = AwsGlueCatalogHook(region_name="us-east-1") self.assertFalse(hook.check_for_partition('db', 'tbl', 'expr'))