Example #1
0
 def test_02_request_package_name(self):
   """ 2: Test request_package_name method from Resource class
       Check if returns a value, which is not NULL """
   resource = Resource(self.testid)
   resource.unpack_object_to_self(resource.load_from_ckan())
   package_name = resource.request_package_name()
   self.failUnless(package_name, 'package name is NULL!')
Example #2
0
  def test_03_get_ckan_url(self):
    """ 3: Test if get_ckan_url method from Resource class
        returns URI string """
    resource = Resource(self.testid)
    resource.unpack_object_to_self(resource.load_from_ckan())
    resource.package_name = resource.request_package_name()

    parsed_url = urlparse(resource.get_ckan_url()) # returns ParseResult class instance
    self.failUnless(parsed_url.scheme, "Scheme is missing.")
    self.failUnless(parsed_url.netloc, "Net Location (e.g. publicdata.eu) is missing.")
    self.failUnless(parsed_url.path, "Path is missing.")