Example #1
0
    def test_method_get_instance(self):
        """Location instance get single location by primary key"""

        location = Location.get(TEST_LOCATION)

        # make sure one location is returned
        self.assertIsInstance(location, Location)
Example #2
0
    def test_method_get_instance(self):
        """Location instance get single location by primary key"""

        location = Location.get(TEST_LOCATION)

        # make sure one location is returned
        self.assertIsInstance(location, Location)
Example #3
0
    def validate(self):

        try:
            location = Location.get(self.code)
        except LocationError as e:
            raise ActionError(
                'Could not determine location from code: "{c}"'.\
                    format(c=self.code)
            )

        self._location = location
Example #4
0
    def validate(self):

        try:
            location = Location.get(self.code)
        except LocationError as e:
            raise ActionError(
                'Could not determine location from code: "{c}"'.\
                    format(c=self.code)
            )

        self._location = location
Example #5
0
    def _validate_location(self):

        # ---- make sure code and server are valid

        # first, set the server value in the environment
        server_var = DpaVars.data_server() 
        server_var.value = self.server
        server_var.set()

        # now query the location code
        try:
            location = Location.get(self.code)
        except ActionError as e:
            raise ActionError(
                "Unable to verify location: " + self.code + "\n" + str(e)
            )

        return location
Example #6
0
 def setUp(self):
     """Get a new location object for each test."""
     self.location = Location.get(TEST_LOCATION)
Example #7
0
 def location(self):
     """:returns: Location that owns this version."""
     return Location.get(self.location_code)
Example #8
0
 def location(self):
     return Location.get(self.location_code)
Example #9
0
 def location(self):
     """:returns: Location that owns this version."""
     return Location.get(self.location_code)
Example #10
0
 def setUp(self):
     """Get a new location object for each test."""
     self.location = Location.get(TEST_LOCATION)
Example #11
0
 def location(self):
     return Location.get(self.location_code)
Example #12
0
 def creation_location(self):
     return Location.get(self.creation_location_code)