~mvo/software-center/fix-index-update-terms-bug

1839.2.1 by Michael Vogt
merged from lp:~aaronp/software-center/tests and tweak a little bit
1
import unittest
2653.1.2 by Michael Vogt
further cleanup to avoid fiddling with sys.path in every test file
2
3020.1.1 by Natalia B. Bidart
- Initial test cleanup:
3
from tests.utils import (
4
    setup_test_env,
5
)
2653.1.2 by Michael Vogt
further cleanup to avoid fiddling with sys.path in every test file
6
setup_test_env()
7
1816.1.23 by Michael Vogt
move the piston APIs into backend.piston
8
from softwarecenter.backend.piston.rnrclient import RatingsAndReviewsAPI
9
from softwarecenter.backend.piston.rnrclient_fake import RatingsAndReviewsAPI as RatingsAndReviewsAPIFake
1839.2.1 by Michael Vogt
merged from lp:~aaronp/software-center/tests and tweak a little bit
10
3020.1.1 by Natalia B. Bidart
- Initial test cleanup:
11
1839.2.1 by Michael Vogt
merged from lp:~aaronp/software-center/tests and tweak a little bit
12
class TestRNRAPI(unittest.TestCase):
13
    """ tests the rnr backend stuff """
14
15
    def test_fake_and_real_provide_similar_methods(self):
16
        """ test if the real and fake sso provide the same functions """
17
        rnr_real = RatingsAndReviewsAPI
18
        rnr_fake = RatingsAndReviewsAPIFake
19
        # ensure that both fake and real implement the same methods
20
        self.assertEqual(
21
            set([x for x in dir(rnr_real) if not x.startswith("_")]),
22
            set([x for x in dir(rnr_fake) if not x.startswith("_")]))
23
24
25
26
if __name__ == "__main__":
27
    unittest.main()