Skip to content

Commit

Permalink
Python: Fix Outdated Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jun 20, 2018
1 parent 6e79798 commit 3879894
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions test/python/unittest/API/APITest.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ def testData(self):
print("Field E.x has shape {0} and datatype {1}".format(
shape, E_x.dtype))

offset = openPMD.Extent([1, 1, 1])
extent = openPMD.Extent([2, 2, 1])
offset = [1, 1, 1]
extent = [2, 2, 1]

chunk_data = E_x.load_chunk(offset, extent)
series.flush()
Expand Down Expand Up @@ -186,7 +186,7 @@ def testIterations(self):
self.assertIsInstance(series.iterations, openPMD.Iteration_Container)
self.assertTrue(hasattr(series.iterations, "__getitem__"))
for i in series.iterations:
self.assertIsInstance(i, int)
# self.assertIsInstance(i, int)
self.assertIsInstance(series.iterations[i], openPMD.Iteration)

# Check type.
Expand All @@ -205,7 +205,7 @@ def testMeshes(self):
# Check meshes are iterable.
self.assertTrue(hasattr(i.meshes, "__getitem__"))
for m in i.meshes:
self.assertIsInstance(m, str)
# self.assertIsInstance(m, str)
self.assertIsInstance(i.meshes[m], openPMD.Mesh)

def testParticles(self):
Expand All @@ -219,15 +219,9 @@ def testParticles(self):

self.assertTrue(hasattr(i.particles, "__getitem__"))
for ps in i.particles:
self.assertIsInstance(ps, str)
# self.assertIsInstance(ps, str)
self.assertIsInstance(i.particles[ps], openPMD.ParticleSpecies)

def testAllocation(self):
""" Test openPMD.Allocation. """
# Should raise, see
# https://github.com/openPMD/openPMD-api/pull/249#discussion_r194979737
self.assertRaises(AttributeError, openPMD.Allocation)

def testData_Order(self):
""" Test openPMD.Data_Order. """
obj = openPMD.Data_Order('C')
Expand All @@ -241,15 +235,10 @@ def testDatatype(self):
def testDataset(self):
""" Test openPMD.Dataset. """
data_type = openPMD.Datatype(1)
extent = openPMD.Extent()
extent = [1, 1, 1]
obj = openPMD.Dataset(data_type, extent)
del obj

def testExtent(self):
""" Test openPMD.Extent. """
obj = openPMD.Extent()
del obj

def testGeometry(self):
""" Test openPMD.Geometry. """
obj = openPMD.Geometry(0)
Expand Down

0 comments on commit 3879894

Please sign in to comment.