Пример #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)
Пример #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)
Пример #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
Пример #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
Пример #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
Пример #6
0
 def setUp(self):
     """Get a new location object for each test."""
     self.location = Location.get(TEST_LOCATION)
Пример #7
0
 def location(self):
     """:returns: Location that owns this version."""
     return Location.get(self.location_code)
Пример #8
0
 def location(self):
     return Location.get(self.location_code)
Пример #9
0
 def location(self):
     """:returns: Location that owns this version."""
     return Location.get(self.location_code)
Пример #10
0
 def setUp(self):
     """Get a new location object for each test."""
     self.location = Location.get(TEST_LOCATION)
Пример #11
0
 def location(self):
     return Location.get(self.location_code)
Пример #12
0
 def creation_location(self):
     return Location.get(self.creation_location_code)