Пример #1
0
 def test_get_defined_partition_columns_hive(self):
     """
     This method tests the correct functionality of get_partition_column_string of Util class
     :return:
     """
     assert Util.get_defined_target_partitions_hive(
         "year") == "year smallint"
     assert Util.get_defined_target_partitions_hive(
         "month") == "year smallint,month smallint"
     assert Util.get_defined_target_partitions_hive(
         "day") == "year smallint,month smallint,day smallint"
     assert Util.get_defined_target_partitions_hive("") == ""
Пример #2
0
    def test_get_defined_partition_columns_hive(self):
        """
        This method tests the correct functionality of get_partition_column_string of Util class
        :return:
        """
        assert Util.get_defined_target_partitions_hive(
            "year") == "year smallint"
        assert Util.get_defined_target_partitions_hive(
            "month") == "year smallint,month smallint"
        assert Util.get_defined_target_partitions_hive(
            "day") == "year smallint,month smallint,day smallint"
        assert Util.get_defined_target_partitions_hive("") == ""

        with pytest.raises(Exception) as exc_info:
            Util.get_target_partitions_list("country")
        assert "Partition type country not supported" in str(exc_info.value)