def test_poke_non_existing(self):
     partitions = [
         "{}.{}/{}={}".format(self.database, self.table, self.partition_by,
                              self.next_day)
     ]
     sensor = NamedHivePartitionSensor(partition_names=partitions,
                                       task_id='test_poke_non_existing',
                                       poke_interval=1,
                                       hook=self.hook,
                                       dag=self.dag)
     self.assertFalse(sensor.poke(None))
 def test_poke_non_existing(self):
     partitions = ["{}.{}/{}={}".format(self.database,
                                        self.table,
                                        self.partition_by,
                                        self.next_day)]
     sensor = NamedHivePartitionSensor(partition_names=partitions,
                                       task_id='test_poke_non_existing',
                                       poke_interval=1,
                                       hook=self.hook,
                                       dag=self.dag)
     self.assertFalse(sensor.poke(None))
 def test_poke_non_existing(self):
     self.hook.metastore.__enter__(
     ).check_for_named_partition.return_value = False
     partitions = [
         "{}.{}/{}={}".format(self.database, self.table, self.partition_by,
                              self.next_day)
     ]
     sensor = NamedHivePartitionSensor(partition_names=partitions,
                                       task_id='test_poke_non_existing',
                                       poke_interval=1,
                                       hook=self.hook,
                                       dag=self.dag)
     self.assertFalse(sensor.poke(None))
     self.hook.metastore.__enter__(
     ).check_for_named_partition.assert_called_with(
         self.database, self.table, "{}={}".format(self.partition_by,
                                                   self.next_day))