Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

# -*- coding: utf-8 -*- 

import re 

 

import httpretty 

import pytest 

 

 

@pytest.yield_fixture(scope='function') 

def mock_hipchat(): 

    """Mock for HipChat room notification API""" 

    httpretty.enable() 

    httpretty.register_uri( 

        httpretty.POST, 

        re.compile('https://api.hipchat.com/v2/room/(\d+)/notification'), 

        status=200, 

    ) 

    yield httpretty 

    httpretty.disable() 

 

 

@pytest.yield_fixture(scope='function') 

def mock_test(): 

    """test""" 

    httpretty.enable() 

    httpretty.register_uri( 

        httpretty.GET, 

        re.compile('https://api.hipchat.com/v2/room/test'), 

        status=200, 

    ) 

    httpretty.register_uri( 

        httpretty.POST, 

        re.compile('https://api.hipchat.com/v2/room/(\d+)/notification'), 

        status=200, 

    ) 

    yield httpretty 

    httpretty.disable()