@@ -0,0 +1,1625 @@
+import unittest%0A%0Aimport dbt.exceptions%0Afrom dbt.task.deps import GitPackage, LocalPackage%0A%0A%0Aclass TestLocalPackage(unittest.TestCase):%0A    def test_init(self):%0A        a = LocalPackage(local='/path/to/package')%0A        a.resolve_version()%0A        self.assertEqual(a.source_type(), 'local')%0A        self.assertEqual(a.local, '/path/to/package')%0A%0A%0Aclass TestGitPackage(unittest.TestCase):%0A    def test_init(self):%0A        a = GitPackage(git='http://example.com', revision='0.0.1')%0A        self.assertEqual(a.git, 'http://example.com')%0A        self.assertEqual(a.revision, '0.0.1')%0A        self.assertEqual(a.version, %5B'0.0.1'%5D)%0A        self.assertEqual(a.source_type(), 'git')%0A%0A    def test_invalid(self):%0A        with self.assertRaises(dbt.exceptions.ValidationException):%0A            GitPackage(git='http://example.com', version='0.0.1')%0A%0A    def test_resolve_ok(self):%0A        a = GitPackage(git='http://example.com', revision='0.0.1')%0A        b = GitPackage(git='http://example.com', revision='0.0.1')%0A        c = a.incorporate(b)%0A        self.assertEqual(c.git, 'http://example.com')%0A        self.assertEqual(c.version, %5B'0.0.1', '0.0.1'%5D)%0A        c.resolve_version()%0A        self.assertEqual(c.version, %5B'0.0.1'%5D)%0A%0A    def test_resovle_fail(self):%0A        a = GitPackage(git='http://example.com', revision='0.0.1')%0A        b = GitPackage(git='http://example.com', revision='0.0.2')%0A        c = a.incorporate(b)%0A        self.assertEqual(c.git, 'http://example.com')%0A        self.assertEqual(c.version, %5B'0.0.1', '0.0.2'%5D)%0A        with self.assertRaises(dbt.exceptions.DependencyException):%0A            c.resolve_version()%0A

package unit tests