Пример #1
0
    def test_canonicalizes(self):
        self.make_participant('alice', claimed_time='now')
        state = self.client.GET('/~Alice/',
                                return_after='dispatch_request_to_filesystem',
                                want='state')

        with self.assertRaises(Response) as cm:
            utils.get_participant(state, restrict=False)
        assert cm.exception.code == 302
        assert cm.exception.headers['Location'] == '/~/alice/'
Пример #2
0
    def test_get_participant_canonicalizes(self):
        self.make_participant('alice', claimed_time='now')
        state = self.client.GET( '/~Alice/'
                               , return_after='dispatch_request_to_filesystem'
                               , want='state'
                                )

        with self.assertRaises(Response) as cm:
            utils.get_participant(state, restrict=False)
        assert cm.exception.code == 302
        assert cm.exception.headers['Location'] == '/~/alice/'
Пример #3
0
    def test_get_participant_canonicalizes(self):
        self.make_participant('alice', claimed_time='now')
        request = self.client.GET(
            '/Alice/',
            return_after='dispatch_request_to_filesystem',
            want='request')

        with self.assertRaises(Response) as cm:
            utils.get_participant(request, restrict=False)
        actual = cm.exception.code

        assert actual == 302
Пример #4
0
    def test_get_participant_canonicalizes(self):
        self.make_participant('alice', claimed_time='now')
        request = self.client.GET( '/Alice/'
                                 , return_after='dispatch_request_to_filesystem'
                                 , want='request'
                                  )

        with self.assertRaises(Response) as cm:
            utils.get_participant(request, restrict=False)
        actual = cm.exception.code

        assert actual == 302
Пример #5
0
 def test_gets_participant(self):
     expected = self.make_participant('alice', claimed_time='now')
     state = self.client.GET('/~alice/',
                             return_after='dispatch_request_to_filesystem',
                             want='state')
     actual = utils.get_participant(state, restrict=False)
     assert actual == expected
Пример #6
0
 def test_get_participant_gets_participant(self):
     expected = self.make_participant('alice', claimed_time='now')
     state = self.client.GET( '/~alice/'
                            , return_after='dispatch_request_to_filesystem'
                            , want='state'
                             )
     actual = utils.get_participant(state, restrict=False)
     assert actual == expected