Skip to content
Snippets Groups Projects
Unverified Commit 081cd510 authored by Michael Emiel Gevaert's avatar Michael Emiel Gevaert Committed by GitHub
Browse files

make explicit tests for edges with libraries (#258)

parent 6ae2beb0
No related branches found
No related tags found
No related merge requests found
......@@ -271,6 +271,17 @@ class TestEdgePopulation(unittest.TestCase):
def test_select_all(self):
self.assertEqual(self.test_obj.select_all().flat_size, 6)
def test_library_enumeration(self):
self.assertEqual(
self.test_obj.get_attribute("E-mapping-good", Selection([(0, 1), (2, 3)])).tolist(),
["C", "C"]
)
self.assertEqual(
self.test_obj.get_enumeration( "E-mapping-good", Selection([(0, 1), (2, 3)])).tolist(),
[2, 2]
)
class TestMisc(unittest.TestCase):
def test_path_ctor(self):
......
......@@ -59,6 +59,12 @@ TEST_CASE("EdgePopulation", "[edges]") {
CHECK(population.connectingEdges({999}, {999}).empty());
// duplicate node IDs are ignored; order of node IDs is not relevant
CHECK(population.connectingEdges({2, 1, 2}, {2, 1, 2}) == Selection({{0, 4}}));
CHECK(population.getAttribute<size_t>("E-mapping-good", Selection({{0, 1}, {2, 3}})) ==
std::vector<size_t>{2, 2});
CHECK(population.getAttribute<std::string>("E-mapping-good", Selection({{0, 1}})) ==
std::vector<std::string>{"C"});
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment