def test_equality(self, station): a = Dashboard(self.dashboard_id, [station], self.pumpkin) b = Dashboard('', [station], True) c = Dashboard(self.dashboard_id, [station], self.pumpkin) assert a != b assert hash(a) != hash(b) assert a is not b assert a == c
def test_de_json_all(self, client, station_result): json_dict = { 'dashboard_id': self.dashboard_id, 'stations': [station_result.to_dict()], 'pumpkin': self.pumpkin } dashboard = Dashboard.de_json(json_dict, client) assert dashboard.dashboard_id == self.dashboard_id assert dashboard.stations == [station_result] assert dashboard.pumpkin == self.pumpkin
def rotor_stations_dashboard(self, timeout=None, *args, **kwargs): url = f'{self.base_url}/rotor/stations/dashboard' result = self._request.get(url, timeout=timeout, *args, **kwargs) return Dashboard.de_json(result, self)
def dashboard(station_result): return Dashboard(TestDashboard.dashboard_id, [station_result], TestDashboard.pumpkin)
def test_de_json_none(self, client): assert Dashboard.de_json({}, client) is None