Beispiel #1
0
 def test_03_harvest_dataset_to_match_existing_service(self):
     package = model.Package.by_name(u'datasetE')
     update_coupled_resources(package, ref_prefix+'Eref')
     assert_equal(self._get_coupled_resources(),
                  change_line(self.couples_before,
                              (u'serviceA', u'Eref', None),
                              (u'serviceA', u'Eref', u'datasetE')))
Beispiel #2
0
 def test_04_harvest_service_to_match_existing_dataset(self):
     package = model.Package.by_name(u'serviceD')
     update_coupled_resources(package, None)
     assert_equal(self._get_coupled_resources(),
                  change_line(self.couples_before,
                              (None, u'Dref', u'datasetD'),
                              (u'serviceD', u'Dref', u'datasetD')))
 def test_04_harvest_service_to_match_existing_dataset(self):
     package = model.Package.by_name(u'serviceD')
     update_coupled_resources(package, None)
     assert_equal(
         self._get_coupled_resources(),
         change_line(self.couples_before, (None, u'Dref', u'datasetD'),
                     (u'serviceD', u'Dref', u'datasetD')))
 def test_03_harvest_dataset_to_match_existing_service(self):
     package = model.Package.by_name(u'datasetE')
     update_coupled_resources(package, ref_prefix + 'Eref')
     assert_equal(
         self._get_coupled_resources(),
         change_line(self.couples_before, (u'serviceA', u'Eref', None),
                     (u'serviceA', u'Eref', u'datasetE')))
Beispiel #5
0
 def test_08_reharvest_existing_service_to_delete_and_add_couples(self):
     package = model.Package.by_name(u'serviceA')
     update_coupled_resources(package, None)
     expected_couples = change_line(self.couples_before,
                                    ('serviceA', u'Cref', 'datasetC'),
                                    (None, 'Cref', 'datasetC'))
     expected_couples = add_line(expected_couples,
                                 (u'serviceA', u'Href', None))
     print 'EXPECTED_COUPLES'; pprint(expected_couples)
     print 'RESULT_COUPLES'; pprint(self._get_coupled_resources())
     assert_equal(self._get_coupled_resources(),
                  expected_couples)
Beispiel #6
0
 def test_08_reharvest_existing_service_to_delete_and_add_couples(self):
     package = model.Package.by_name(u'serviceA')
     update_coupled_resources(package, None)
     expected_couples = change_line(self.couples_before,
                                    ('serviceA', u'Cref', 'datasetC'),
                                    (None, 'Cref', 'datasetC'))
     expected_couples = add_line(expected_couples,
                                 (u'serviceA', u'Href', None))
     print 'EXPECTED_COUPLES'; pprint(expected_couples)
     print 'RESULT_COUPLES'; pprint(self._get_coupled_resources())
     assert_equal(self._get_coupled_resources(),
                  expected_couples)
Beispiel #7
0
 def test_07_reharvest_existing_dataset_but_with_changed_ref(self):
     # This may occur only in a WAF. If a dataset is reharvested from
     # a different WAF URL then the old WAF URL (and therefore ref)
     # for that dataset becomes invalid.
     # (A CSW may change a dataset's GUID, but it becomes a different
     # datasets entirely if that happens)
     package = model.Package.by_name(u'datasetB')
     update_coupled_resources(package, ref_prefix+'Jref')
     expected_couples = change_line(self.couples_before,
                                    ('serviceA', u'Bref', 'datasetB'),
                                    ('serviceA', u'Bref', None))
     expected_couples = add_line(expected_couples,
                                 (None, u'Jref', 'datasetB'))
     assert_equal(self._get_coupled_resources(), expected_couples)
 def test_07_reharvest_existing_dataset_but_with_changed_ref(self):
     # This may occur only in a WAF. If a dataset is reharvested from
     # a different WAF URL then the old WAF URL (and therefore ref)
     # for that dataset becomes invalid.
     # (A CSW may change a dataset's GUID, but it becomes a different
     # datasets entirely if that happens)
     package = model.Package.by_name(u'datasetB')
     update_coupled_resources(package, ref_prefix + 'Jref')
     expected_couples = change_line(self.couples_before,
                                    ('serviceA', u'Bref', 'datasetB'),
                                    ('serviceA', u'Bref', None))
     expected_couples = add_line(expected_couples,
                                 (None, u'Jref', 'datasetB'))
     assert_equal(self._get_coupled_resources(), expected_couples)
Beispiel #9
0
 def test_01_reharvest_existing_dataset(self):
     package = model.Package.by_name(u'datasetB')
     update_coupled_resources(package, ref_prefix+'Bref')
     assert_equal(self._get_coupled_resources(), self.couples_before)
Beispiel #10
0
 def test_06_harvest_service_not_matching_a_dataset(self):
     package = model.Package.by_name(u'serviceG')
     update_coupled_resources(package, None)
     assert_equal(self._get_coupled_resources(),
                  add_line(self.couples_before,
                           (u'serviceG', u'Gref', None)))
Beispiel #11
0
 def test_05_harvest_dataset_not_matching_a_service(self):
     package = model.Package.by_name(u'datasetG')
     update_coupled_resources(package, ref_prefix+'Gref')
     assert_equal(self._get_coupled_resources(),
                  add_line(self.couples_before,
                           (None, u'Gref', u'datasetG')))
Beispiel #12
0
 def test_02_reharvest_existing_service(self):
     package = model.Package.by_name(u'serviceF')
     update_coupled_resources(package, None)
     assert_equal(self._get_coupled_resources(), self.couples_before)
 def test_06_harvest_service_not_matching_a_dataset(self):
     package = model.Package.by_name(u'serviceG')
     update_coupled_resources(package, None)
     assert_equal(
         self._get_coupled_resources(),
         add_line(self.couples_before, (u'serviceG', u'Gref', None)))
 def test_05_harvest_dataset_not_matching_a_service(self):
     package = model.Package.by_name(u'datasetG')
     update_coupled_resources(package, ref_prefix + 'Gref')
     assert_equal(
         self._get_coupled_resources(),
         add_line(self.couples_before, (None, u'Gref', u'datasetG')))
 def test_02_reharvest_existing_service(self):
     package = model.Package.by_name(u'serviceF')
     update_coupled_resources(package, None)
     assert_equal(self._get_coupled_resources(), self.couples_before)
 def test_01_reharvest_existing_dataset(self):
     package = model.Package.by_name(u'datasetB')
     update_coupled_resources(package, ref_prefix + 'Bref')
     assert_equal(self._get_coupled_resources(), self.couples_before)