(self)
| 193 | cls.mapper_registry.map_imperatively(Report, weather_reports) |
| 194 | |
| 195 | def _fixture_data(self): |
| 196 | tokyo = WeatherLocation("Asia", "Tokyo") |
| 197 | newyork = WeatherLocation("North America", "New York") |
| 198 | toronto = WeatherLocation("North America", "Toronto") |
| 199 | london = WeatherLocation("Europe", "London") |
| 200 | dublin = WeatherLocation("Europe", "Dublin") |
| 201 | brasilia = WeatherLocation("South America", "Brasilia") |
| 202 | quito = WeatherLocation("South America", "Quito") |
| 203 | tokyo.reports.append(Report(80.0, id_=1)) |
| 204 | newyork.reports.append(Report(75, id_=1)) |
| 205 | quito.reports.append(Report(85)) |
| 206 | sess = sharded_session() |
| 207 | for c in [tokyo, newyork, toronto, london, dublin, brasilia, quito]: |
| 208 | sess.add(c) |
| 209 | sess.flush() |
| 210 | |
| 211 | eq_(inspect(newyork).key[2], "north_america") |
| 212 | eq_(inspect(newyork).identity_token, "north_america") |
| 213 | eq_(inspect(dublin).key[2], "europe") |
| 214 | eq_(inspect(dublin).identity_token, "europe") |
| 215 | |
| 216 | sess.commit() |
| 217 | sess.close() |
| 218 | return sess |
| 219 | |
| 220 | def test_get(self): |
| 221 | sess = self._fixture_data() |
no test coverage detected