Skip to content
Permalink
Browse files

remove tests for deleted code

  • Loading branch information
ralsina committed May 29, 2017
1 parent 5385b80 commit eebb77e0dc288237b845047e05d647d6e409c795
Showing with 0 additions and 30 deletions.
  1. +0 −30 tests/test_utils.py
@@ -42,32 +42,6 @@ def test_getting_metadata_from_content(self):
self.assertFalse('description' in meta)
self.assertTrue(nsm)

def test_get_title_from_rest(self):
file_metadata = ".. slug: write-tests-now\n"\
".. date: 2012/09/15 19:52:05\n"\
".. tags:\n"\
".. link:\n"\
".. description:\n\n"\
"Post Title\n"\
"----------\n"

opener_mock = mock.mock_open(read_data=file_metadata)

post = dummy()
post.source_path = 'file_with_metadata'
post.metadata_path = 'file_with_metadata.meta'

with mock.patch('nikola.post.io.open', opener_mock, create=True):
meta, nsm = get_meta(post)

self.assertEqual('Post Title', meta['title'])
self.assertEqual('write-tests-now', meta['slug'])
self.assertEqual('2012/09/15 19:52:05', meta['date'])
self.assertFalse('tags' in meta)
self.assertFalse('link' in meta)
self.assertFalse('description' in meta)
self.assertTrue(nsm)

def test_get_title_from_fname(self):
file_metadata = ".. slug: write-tests-now\n"\
".. date: 2012/09/15 19:52:05\n"\
@@ -322,13 +296,9 @@ def test_get_metadata_from_file():
from nikola.post import _get_metadata_from_file
g = _get_metadata_from_file
assert list(g([]).values()) == []
assert str(g(["======", "FooBar", "======"])["title"]) == 'FooBar'
assert str(g(["FooBar", "======"])["title"]) == 'FooBar'
assert str(g(["#FooBar"])["title"]) == 'FooBar'
assert str(g([".. title: FooBar"])["title"]) == 'FooBar'
assert 'title' not in g(["", "", ".. title: FooBar"])
assert 'title' in g(["", ".. title: FooBar"])
assert 'title' in g([".. foo: bar", "", "FooBar", "------"])


def test_get_asset_path():

0 comments on commit eebb77e

Please sign in to comment.