@@ -51,8 +51,7 @@ def test_init(self, connector, exists, mocker, tmp_path):
51
51
assert connector .support_level is None
52
52
assert connector .acceptance_test_config is None
53
53
assert connector .icon_path == Path (f"./airbyte-integrations/connectors/{ connector .technical_name } /icon.svg" )
54
- with pytest .raises (FileNotFoundError ):
55
- connector .version
54
+ assert connector .version is None
56
55
with pytest .raises (utils .ConnectorVersionNotFound ):
57
56
Path (tmp_path / "Dockerfile" ).touch ()
58
57
mocker .patch .object (utils .Connector , "code_directory" , tmp_path )
@@ -73,6 +72,25 @@ def test_metadata_query_match(self, mocker):
73
72
assert not connector .metadata_query_match ("data.ab_internal.ql > 101" )
74
73
assert not connector .metadata_query_match ("data.ab_internal == whatever" )
75
74
75
+ @pytest .fixture
76
+ def connector_without_dockerfile (self , mocker , tmp_path ):
77
+ mocker .patch .object (utils .Connector , "code_directory" , tmp_path )
78
+ connector = utils .Connector ("source-faker" )
79
+ return connector
80
+
81
+ def test_has_dockerfile_without_dockerfile (self , connector_without_dockerfile ):
82
+ assert not connector_without_dockerfile .has_dockerfile
83
+
84
+ @pytest .fixture
85
+ def connector_with_dockerfile (self , mocker , tmp_path ):
86
+ mocker .patch .object (utils .Connector , "code_directory" , tmp_path )
87
+ connector = utils .Connector ("source-faker" )
88
+ tmp_path .joinpath ("Dockerfile" ).touch ()
89
+ return connector
90
+
91
+ def test_has_dockerfile_with_dockerfile (self , connector_with_dockerfile ):
92
+ assert connector_with_dockerfile .has_dockerfile
93
+
76
94
77
95
@pytest .fixture ()
78
96
def gradle_file_with_dependencies (tmpdir ) -> Path :
@@ -105,49 +123,3 @@ def test_parse_dependencies(gradle_file_with_dependencies):
105
123
assert all ([regular_dependency in expected_regular_dependencies for regular_dependency in regular_dependencies ])
106
124
assert len (test_dependencies ) == len (expected_test_dependencies )
107
125
assert all ([test_dependency in expected_test_dependencies for test_dependency in test_dependencies ])
108
-
109
-
110
- @pytest .mark .parametrize ("with_test_dependencies" , [True , False ])
111
- def test_get_all_gradle_dependencies (with_test_dependencies ):
112
- build_file = Path ("airbyte-integrations/connectors/source-postgres-strict-encrypt/build.gradle" )
113
- if with_test_dependencies :
114
- all_dependencies = utils .get_all_gradle_dependencies (build_file )
115
- expected_dependencies = [
116
- Path ("airbyte-cdk/java/airbyte-cdk" ),
117
- Path ("airbyte-db/db-lib" ),
118
- Path ("airbyte-json-validation" ),
119
- Path ("airbyte-config-oss/config-models-oss" ),
120
- Path ("airbyte-commons" ),
121
- Path ("airbyte-test-utils" ),
122
- Path ("airbyte-api" ),
123
- Path ("airbyte-connector-test-harnesses/acceptance-test-harness" ),
124
- Path ("airbyte-commons-protocol" ),
125
- Path ("airbyte-integrations/bases/base-java" ),
126
- Path ("airbyte-commons-cli" ),
127
- Path ("airbyte-integrations/bases/base" ),
128
- Path ("airbyte-integrations/connectors/source-postgres" ),
129
- Path ("airbyte-integrations/bases/debezium" ),
130
- Path ("airbyte-integrations/connectors/source-jdbc" ),
131
- Path ("airbyte-integrations/connectors/source-relational-db" ),
132
- Path ("airbyte-integrations/bases/standard-source-test" ),
133
- ]
134
- assert len (all_dependencies ) == len (expected_dependencies )
135
- assert all ([dependency in expected_dependencies for dependency in all_dependencies ])
136
- else :
137
- all_dependencies = utils .get_all_gradle_dependencies (build_file , with_test_dependencies = False )
138
- expected_dependencies = [
139
- Path ("airbyte-cdk/java/airbyte-cdk" ),
140
- Path ("airbyte-db/db-lib" ),
141
- Path ("airbyte-json-validation" ),
142
- Path ("airbyte-config-oss/config-models-oss" ),
143
- Path ("airbyte-commons" ),
144
- Path ("airbyte-integrations/bases/base-java" ),
145
- Path ("airbyte-commons-cli" ),
146
- Path ("airbyte-integrations/bases/base" ),
147
- Path ("airbyte-integrations/connectors/source-postgres" ),
148
- Path ("airbyte-integrations/bases/debezium" ),
149
- Path ("airbyte-integrations/connectors/source-jdbc" ),
150
- Path ("airbyte-integrations/connectors/source-relational-db" ),
151
- ]
152
- assert len (all_dependencies ) == len (expected_dependencies )
153
- assert all ([dependency in expected_dependencies for dependency in all_dependencies ])
0 commit comments