コード例 #1
0
ファイル: test_label.py プロジェクト: lldcl/mne-python
def test_label_subject():
    """Test label subject name extraction."""
    label = read_label(label_fname)
    assert_is(label.subject, None)
    assert_true('unknown' in repr(label))
    label = read_label(label_fname, subject='fsaverage')
    assert_true(label.subject == 'fsaverage')
    assert_true('fsaverage' in repr(label))
コード例 #2
0
ファイル: test_label.py プロジェクト: kambysese/mne-python
def test_label_subject():
    """Test label subject name extraction."""
    label = read_label(label_fname)
    assert_is(label.subject, None)
    assert ('unknown' in repr(label))
    label = read_label(label_fname, subject='fsaverage')
    assert (label.subject == 'fsaverage')
    assert ('fsaverage' in repr(label))
コード例 #3
0
ファイル: test_label.py プロジェクト: YoheiOseki/mne-python
def test_label_subject():
    """Test label subject name extraction
    """
    label = read_label(label_fname)
    assert_is(label.subject, None)
    assert_true("unknown" in repr(label))
    label = read_label(label_fname, subject="fsaverage")
    assert_true(label.subject == "fsaverage")
    assert_true("fsaverage" in repr(label))
コード例 #4
0
ファイル: test_label.py プロジェクト: lldcl/mne-python
def test_label_io():
    """Test IO of label files."""
    tempdir = _TempDir()
    label = read_label(label_fname)

    # label attributes
    assert_equal(label.name, 'test-lh')
    assert_is(label.subject, None)
    assert_is(label.color, None)

    # save and reload
    label.save(op.join(tempdir, 'foo'))
    label2 = read_label(op.join(tempdir, 'foo-lh.label'))
    assert_labels_equal(label, label2)

    # pickling
    dest = op.join(tempdir, 'foo.pickled')
    with open(dest, 'wb') as fid:
        pickle.dump(label, fid, pickle.HIGHEST_PROTOCOL)
    with open(dest, 'rb') as fid:
        label2 = pickle.load(fid)
    assert_labels_equal(label, label2)
コード例 #5
0
ファイル: test_label.py プロジェクト: Anevar/mne-python
def test_label_io():
    """Test IO of label files
    """
    label = read_label(label_fname)

    # label attributes
    assert_equal(label.name, 'test-lh')
    assert_is(label.subject, None)
    assert_is(label.color, None)

    # save and reload
    label.save(op.join(tempdir, 'foo'))
    label2 = read_label(op.join(tempdir, 'foo-lh.label'))
    assert_labels_equal(label, label2)

    # pickling
    dest = op.join(tempdir, 'foo.pickled')
    with open(dest, 'wb') as fid:
        pickle.dump(label, fid, pickle.HIGHEST_PROTOCOL)
    with open(dest, 'rb') as fid:
        label2 = pickle.load(fid)
    assert_labels_equal(label, label2)
コード例 #6
0
ファイル: test_label.py プロジェクト: YoheiOseki/mne-python
def test_label_io():
    """Test IO of label files
    """
    tempdir = _TempDir()
    label = read_label(label_fname)

    # label attributes
    assert_equal(label.name, "test-lh")
    assert_is(label.subject, None)
    assert_is(label.color, None)

    # save and reload
    label.save(op.join(tempdir, "foo"))
    label2 = read_label(op.join(tempdir, "foo-lh.label"))
    assert_labels_equal(label, label2)

    # pickling
    dest = op.join(tempdir, "foo.pickled")
    with open(dest, "wb") as fid:
        pickle.dump(label, fid, pickle.HIGHEST_PROTOCOL)
    with open(dest, "rb") as fid:
        label2 = pickle.load(fid)
    assert_labels_equal(label, label2)