def test_resolver(self): res = avocado_golang.GolangResolver().resolve('countavocados') self.assertEqual(res.result, ReferenceResolutionResult.SUCCESS) self.assertEqual(len(res.resolutions), 2) empty_container = res.resolutions[0] self.assertEqual(empty_container.kind, 'golang') self.assertEqual(empty_container.uri, 'countavocados:TestEmptyContainers') no_container = res.resolutions[1] self.assertEqual(no_container.kind, 'golang') self.assertEqual(no_container.uri, 'countavocados:TestNoContainers')
def test_resolver_no_go_bin(self): with unittest.mock.patch('avocado_golang.GO_BIN', None): res = avocado_golang.GolangResolver().resolve('countavocados') self.assertEqual(res.reference, 'countavocados') self.assertEqual(res.result, ReferenceResolutionResult.NOTFOUND)