(self)
| 350 | |
| 351 | class TestSaveTxt: |
| 352 | def test_array(self): |
| 353 | a = np.array([[1, 2], [3, 4]], float) |
| 354 | fmt = "%.18e" |
| 355 | c = BytesIO() |
| 356 | np.savetxt(c, a, fmt=fmt) |
| 357 | c.seek(0) |
| 358 | assert_equal(c.readlines(), |
| 359 | [asbytes((fmt + ' ' + fmt + '\n') % (1, 2)), |
| 360 | asbytes((fmt + ' ' + fmt + '\n') % (3, 4))]) |
| 361 | |
| 362 | a = np.array([[1, 2], [3, 4]], int) |
| 363 | c = BytesIO() |
| 364 | np.savetxt(c, a, fmt='%d') |
| 365 | c.seek(0) |
| 366 | assert_equal(c.readlines(), [b'1 2\n', b'3 4\n']) |
| 367 | |
| 368 | def test_1D(self): |
| 369 | a = np.array([1, 2, 3, 4], int) |
nothing calls this directly
no test coverage detected