File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
tests/venv_site_packages_libs Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 11load ("//python:py_library.bzl" , "py_library" )
22load ("//tests/support:py_reconfig.bzl" , "py_reconfig_test" )
33load ("//tests/support:support.bzl" , "SUPPORTS_BOOTSTRAP_SCRIPT" )
4+ load (":depset_tests.bzl" , "depset_test_suite" )
5+
6+ depset_test_suite (
7+ name = "depset_tests" ,
8+ )
49
510py_library (
611 name = "user_lib" ,
Original file line number Diff line number Diff line change 1+ ""
2+
3+ load ("@rules_testing//lib:test_suite.bzl" , "test_suite" )
4+
5+ _tests = []
6+
7+ def _test_simple (env ):
8+ c1 = depset (
9+ ["c1" ],
10+ order = "topological" ,
11+ )
12+ c2 = depset (
13+ ["c2" ],
14+ order = "topological" ,
15+ )
16+ b = depset (
17+ ["b" ],
18+ transitive = [c1 ],
19+ order = "topological" ,
20+ )
21+ a1 = depset (
22+ ["A" ],
23+ transitive = [c2 , b ],
24+ order = "topological" ,
25+ )
26+ a2 = depset (
27+ ["A" ],
28+ transitive = [b , c2 ],
29+ order = "topological" ,
30+ )
31+
32+ got1 = a1 .to_list ()
33+ got2 = a2 .to_list ()
34+
35+ env .expect .that_collection (got1 ).contains_exactly (
36+ ["A" , "c2" , "b" , "c1" ],
37+ ).in_order ()
38+ env .expect .that_collection (got2 ).contains_exactly (
39+ ["A" , "b" , "c1" , "c2" ],
40+ ).in_order ()
41+
42+ _tests .append (_test_simple )
43+
44+ def depset_test_suite (name ):
45+ """Create the test suite.
46+
47+ Args:
48+ name: the name of the test suite
49+ """
50+ test_suite (name = name , basic_tests = _tests )
You can’t perform that action at this time.
0 commit comments