def testMappingPassNew(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(BASIC) with mock.patch('owners_file_tags.open', create=True) as mock_open_2: mock_open_2.return_value = mock_file(BASIC) self.assertEqual(0, checkteamtags.main())
def testBasic(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(BASIC) self.assertEqual(0, checkteamtags.main())
def testMultipleTeamsInTag(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(MULTIPLE_TEAMS_IN_TAG) self.assertEqual(1, checkteamtags.main())
def testMissingTeam(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(MISSING_TEAM) self.assertEqual(1, checkteamtags.main())
def testMissingComponent(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(MISSING_COMPONENT) self.assertEqual(1, checkteamtags.main())
def testMultipleComponentTags(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(MULTIPLE_COMPONENT_TAGS) self.assertEqual(1, checkteamtags.main())
def testNoTags(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(NO_TAGS) self.assertEqual(0, checkteamtags.main())
def testInvalidTeamPrefix3(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(INVALID_TEAM_PREFIX3) self.assertEqual(1, checkteamtags.main())
def testInvalidComponentPrefix2(self): with mock.patch(open_name, create=True) as mock_open: mock_open.return_value = mock_file(INVALID_COMPONENT_PREFIX2) self.assertEqual(1, checkteamtags.main())