(self)
| 366 | |
| 367 | class TestSaveTxt: |
| 368 | def test_array(self): |
| 369 | a = np.array([[1, 2], [3, 4]], float) |
| 370 | fmt = "%.18e" |
| 371 | c = BytesIO() |
| 372 | np.savetxt(c, a, fmt=fmt) |
| 373 | c.seek(0) |
| 374 | assert_equal(c.readlines(), |
| 375 | [asbytes((fmt + ' ' + fmt + '\n') % (1, 2)), |
| 376 | asbytes((fmt + ' ' + fmt + '\n') % (3, 4))]) |
| 377 | |
| 378 | a = np.array([[1, 2], [3, 4]], int) |
| 379 | c = BytesIO() |
| 380 | np.savetxt(c, a, fmt='%d') |
| 381 | c.seek(0) |
| 382 | assert_equal(c.readlines(), [b'1 2\n', b'3 4\n']) |
| 383 | |
| 384 | def test_1D(self): |
| 385 | a = np.array([1, 2, 3, 4], int) |
nothing calls this directly
no test coverage detected