(self)
| 726 | } |
| 727 | |
| 728 | def test_get_all_credentials_3_sources(self): |
| 729 | self.authconfig['credHelpers'] = { |
| 730 | 'registry1.io': 'truesecret', |
| 731 | } |
| 732 | truesecret = InMemoryStore('truesecret') |
| 733 | truesecret.store('registry1.io', 'reimu', 'hakurei') |
| 734 | self.authconfig._stores['truesecret'] = truesecret |
| 735 | self.authconfig.add_auth('registry2.io', { |
| 736 | 'ServerAddress': 'registry2.io', |
| 737 | 'Username': 'reimu', |
| 738 | 'Password': 'hakurei', |
| 739 | }) |
| 740 | |
| 741 | assert self.authconfig.get_all_credentials() == { |
| 742 | 'https://gensokyo.jp/v2': { |
| 743 | 'Username': 'sakuya', |
| 744 | 'Password': 'izayoi', |
| 745 | 'ServerAddress': 'https://gensokyo.jp/v2', |
| 746 | }, |
| 747 | 'gensokyo.jp': { |
| 748 | 'Username': 'sakuya', |
| 749 | 'Password': 'izayoi', |
| 750 | 'ServerAddress': 'https://gensokyo.jp/v2', |
| 751 | }, |
| 752 | 'https://default.com/v2': { |
| 753 | 'Username': 'user', |
| 754 | 'Password': 'hunter2', |
| 755 | 'ServerAddress': 'https://default.com/v2', |
| 756 | }, |
| 757 | 'default.com': { |
| 758 | 'Username': 'user', |
| 759 | 'Password': 'hunter2', |
| 760 | 'ServerAddress': 'https://default.com/v2', |
| 761 | }, |
| 762 | 'registry1.io': { |
| 763 | 'ServerAddress': 'registry1.io', |
| 764 | 'Username': 'reimu', |
| 765 | 'Password': 'hakurei', |
| 766 | }, |
| 767 | 'registry2.io': { |
| 768 | 'ServerAddress': 'registry2.io', |
| 769 | 'Username': 'reimu', |
| 770 | 'Password': 'hakurei', |
| 771 | } |
| 772 | } |
| 773 | |
| 774 | |
| 775 | class InMemoryStore(credentials.Store): |
nothing calls this directly
no test coverage detected