Revision 8204cb4c

b/astakosclient/astakosclient/tests.py
65 65
auth_url = "https://example.org/identity/v2.0"
66 66
account_prefix = "/account_prefix"
67 67
ui_prefix = "/ui_prefix"
68
oauth2_prefix = "/oauth2"
68 69
api_tokens = "/identity/v2.0/tokens"
69 70
api_usercatalogs = join_urls(account_prefix, "user_catalogs")
70 71
api_resources = join_urls(account_prefix, "resources")
......
97 98

  
98 99
endpoints = {
99 100
    "access": {
100
        "serviceCatalog": [{
101
            "endpoints": [{"SNF:uiURL": join_urls("https://example.org/",
102
                                                  ui_prefix),
103
                           "publicURL": join_urls("https://example.org/",
104
                                                  account_prefix),
105
                           "region": "default",
106
                           "versionId": "v1.0"}],
107
            "name": "astakos_account",
108
            "type": "account"}]
101
        "serviceCatalog": [
102
            {"endpoints": [{"SNF:uiURL": join_urls("https://example.org/",
103
                                                   ui_prefix),
104
                            "publicURL": join_urls("https://example.org/",
105
                                                   account_prefix),
106
                            "region": "default",
107
                            "versionId": "v1.0"}],
108
             "name": "astakos_account",
109
             "type": "account"
110
             },
111
            {"endpoints": [{"SNF:uiURL": join_urls("https://example.org/",
112
                                                   ui_prefix),
113
                            "publicURL": join_urls("https://example.org/",
114
                                                   oauth2_prefix),
115
                            "region": "default",
116
                            "versionId": "v1.0"}],
117
             "name": "astakos_oauth2",
118
             "type": "astakos_auth"
119
             }]
109 120
        }
110 121
    }
111 122

  
......
414 425
    """Test cases for function _callAstakos"""
415 426

  
416 427
    # Patch astakosclient's _do_request function
417
    def setUp(self):
428
    def setUp(self):  # noqa
418 429
        astakosclient._do_request = _mock_request
419 430

  
420 431
    # ----------------------------------
......
556 567
    """Test cases for function getUserInfo"""
557 568

  
558 569
    # Patch astakosclient's _do_request function
559
    def setUp(self):
570
    def setUp(self):  # noqa
560 571
        astakosclient._do_request = _mock_request
561 572

  
562 573
    # ----------------------------------
......
589 600
        try:
590 601
            client = AstakosClient(token['id'], auth_url, use_pool=pool)
591 602
            auth_info = client.authenticate()
592
        except:
593
            self.fail("Shouldn't raise an Exception")
603
        except Exception as err:
604
            self.fail("Shouldn't raise an Exception: %s" % err)
594 605
        self.assertEqual(endpoints_with_info, auth_info)
595 606

  
596 607
    def test_auth_user(self):
......
606 617
    """Test cases for functions getDisplayNames/getDisplayName"""
607 618

  
608 619
    # Patch astakosclient's _do_request function
609
    def setUp(self):
620
    def setUp(self):  # noqa
610 621
        astakosclient._do_request = _mock_request
611 622

  
612 623
    # ----------------------------------
......
657 668
    """Test cases for functions getUUIDs/getUUID"""
658 669

  
659 670
    # Patch astakosclient's _do_request function
660
    def setUp(self):
671
    def setUp(self):  # noqa
661 672
        astakosclient._do_request = _mock_request
662 673

  
663 674
    # ----------------------------------
......
707 718
    """Test cases for function get_resources"""
708 719

  
709 720
    # Patch astakosclient's _do_request function
710
    def setUp(self):
721
    def setUp(self):  # noqa
711 722
        astakosclient._do_request = _mock_request
712 723

  
713 724
    # ----------------------------------
......
726 737
    """Test cases for function get_quotas"""
727 738

  
728 739
    # Patch astakosclient's _do_request function
729
    def setUp(self):
740
    def setUp(self):  # noqa
730 741
        astakosclient._do_request = _mock_request
731 742

  
732 743
    # ----------------------------------
......
760 771
    """Test cases for quota commissions"""
761 772

  
762 773
    # Patch astakosclient's _do_request function
763
    def setUp(self):
774
    def setUp(self):  # noqa
764 775
        astakosclient._do_request = _mock_request
765 776

  
766 777
    # ----------------------------------

Also available in: Unified diff