예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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)
예제 #4
0
def dashboard(station_result):
    return Dashboard(TestDashboard.dashboard_id, [station_result],
                     TestDashboard.pumpkin)
예제 #5
0
 def test_de_json_none(self, client):
     assert Dashboard.de_json({}, client) is None