Exemplo n.º 1
0
class oauthConsumerTest(unittest.TestCase):
    def setUp(self):
        self.sut = OAuthConsumer()

    def tearDown(self):
        self.sut = None

    """
    method: getConsumer
    when: called
    with: key
    should: calledSelectConsumerMongoDb
    """

    def test_getConsumer_called_key_calledSelectConsumerMongoDb(self):
        consumerKey = "1234"
        consumerSecret = "ABCD"
        self.sut.selectConsumer = Mock()
        self.sut.selectConsumer.return_value = consumerSecret
        self.sut.getConsumer(consumerKey)
        self.sut.selectConsumer.assert_called_once_with(consumerKey)
        self.assertEquals(consumerSecret, self.sut.secret)
Exemplo n.º 2
0
class oauthConsumerTest(unittest.TestCase):

    def setUp(self):
        self.sut = OAuthConsumer()

    def tearDown(self):
        self.sut = None

    """
    method: getConsumer
    when: called
    with: key
    should: calledSelectConsumerMongoDb
    """
    def test_getConsumer_called_key_calledSelectConsumerMongoDb(self):
        consumerKey = "1234"
        consumerSecret = "ABCD"
        self.sut.selectConsumer = Mock()
        self.sut.selectConsumer.return_value = consumerSecret
        self.sut.getConsumer(consumerKey)
        self.sut.selectConsumer.assert_called_once_with(consumerKey)
        self.assertEquals(consumerSecret,self.sut.secret)
Exemplo n.º 3
0
 def setUp(self):
     self.sut = OAuthConsumer()
Exemplo n.º 4
0
 def setUp(self):
     self.sut = OAuthConsumer()