|
14 | 14 |
|
15 | 15 | """Integration tests for license validator."""
|
16 | 16 |
|
17 |
| - |
18 | 17 | from licensevalidator.licensevalidator import validate_used_licenses
|
19 | 18 |
|
20 | 19 |
|
@@ -98,56 +97,56 @@ def test_javascript():
|
98 | 97 | assert origin_vs_deps["JavaScript"][1].version == "4.6.3"
|
99 | 98 |
|
100 | 99 |
|
101 |
| -# def test_cpp(): |
102 |
| -# """Test cpp project.""" |
103 |
| -# result, origin_vs_deps = validate_used_licenses( |
104 |
| -# "./testbench/multilang/cpp-proj", |
105 |
| -# [{"path": ".", "cpp-conan-included-profile-files": ["./conan_profile"]}], |
106 |
| -# "../whitelist.txt", |
107 |
| -# ) |
| 100 | +def test_cpp(): |
| 101 | + """Test cpp project.""" |
| 102 | + result, origin_vs_deps = validate_used_licenses( |
| 103 | + "./testbench/multilang/cpp-proj", |
| 104 | + [{"path": ".", "cpp-conan-included-profile-files": ["./conan_profile"]}], |
| 105 | + "../whitelist.txt", |
| 106 | + ) |
108 | 107 |
|
109 |
| -# assert result |
110 |
| -# assert len(origin_vs_deps) == 1 |
111 |
| -# assert "c++" in origin_vs_deps |
| 108 | + assert result |
| 109 | + assert len(origin_vs_deps) == 1 |
| 110 | + assert "c++" in origin_vs_deps |
112 | 111 |
|
113 |
| -# index = 0 |
114 |
| -# assert origin_vs_deps["c++"][index].name == "abseil" |
| 112 | + index = 0 |
| 113 | + assert origin_vs_deps["c++"][index].name == "abseil" |
115 | 114 |
|
116 |
| -# index += 1 |
117 |
| -# assert origin_vs_deps["c++"][index].name == "c-ares" |
| 115 | + index += 1 |
| 116 | + assert origin_vs_deps["c++"][index].name == "c-ares" |
118 | 117 |
|
119 |
| -# index += 1 |
120 |
| -# assert origin_vs_deps["c++"][index].name == "grpc" |
| 118 | + index += 1 |
| 119 | + assert origin_vs_deps["c++"][index].name == "grpc" |
121 | 120 |
|
122 |
| -# index += 1 |
123 |
| -# assert origin_vs_deps["c++"][index].name == "gtest" |
| 121 | + index += 1 |
| 122 | + assert origin_vs_deps["c++"][index].name == "gtest" |
124 | 123 |
|
125 |
| -# index += 1 |
126 |
| -# assert origin_vs_deps["c++"][index].name == "openssl" |
| 124 | + index += 1 |
| 125 | + assert origin_vs_deps["c++"][index].name == "openssl" |
127 | 126 |
|
128 |
| -# index += 1 |
129 |
| -# assert origin_vs_deps["c++"][index].name == "protobuf" |
| 127 | + index += 1 |
| 128 | + assert origin_vs_deps["c++"][index].name == "protobuf" |
130 | 129 |
|
131 |
| -# index += 1 |
132 |
| -# assert origin_vs_deps["c++"][index].name == "re2" |
| 130 | + index += 1 |
| 131 | + assert origin_vs_deps["c++"][index].name == "re2" |
133 | 132 |
|
134 |
| -# index += 1 |
135 |
| -# assert origin_vs_deps["c++"][index].name == "zlib" |
| 133 | + index += 1 |
| 134 | + assert origin_vs_deps["c++"][index].name == "zlib" |
136 | 135 |
|
137 | 136 |
|
138 |
| -# def test_multilang(): |
139 |
| -# result, origin_vs_deps = validate_used_licenses( |
140 |
| -# "./testbench/multilang", |
141 |
| -# [ |
142 |
| -# {"path": "cpp-proj", "cpp-conan-included-profile-files": ["conan_profile"]}, |
143 |
| -# {"path": "rust-proj"}, |
144 |
| -# {"path": "python-proj"}, |
145 |
| -# ], |
146 |
| -# "whitelist.txt", |
147 |
| -# ) |
| 137 | +def test_multilang(): |
| 138 | + result, origin_vs_deps = validate_used_licenses( |
| 139 | + "./testbench/multilang", |
| 140 | + [ |
| 141 | + {"path": "cpp-proj", "cpp-conan-included-profile-files": ["conan_profile"]}, |
| 142 | + {"path": "rust-proj"}, |
| 143 | + {"path": "python-proj"}, |
| 144 | + ], |
| 145 | + "whitelist.txt", |
| 146 | + ) |
148 | 147 |
|
149 |
| -# assert result is False |
150 |
| -# assert len(origin_vs_deps) == 3 |
151 |
| -# assert "c++" in origin_vs_deps |
152 |
| -# assert "Rust" in origin_vs_deps |
153 |
| -# assert "Python" in origin_vs_deps |
| 148 | + assert result is False |
| 149 | + assert len(origin_vs_deps) == 3 |
| 150 | + assert "c++" in origin_vs_deps |
| 151 | + assert "Rust" in origin_vs_deps |
| 152 | + assert "Python" in origin_vs_deps |
0 commit comments