提交 88549831 编写于 作者: B Bastian Blank 提交者: Joerg Jaspert

Add tests for Architecture, Section

上级 f32101ed
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
################################################################################
import pytest
from .architecture import Architecture
def test_Architecture(session):
obj = Architecture('arch', 'description')
session.add(obj)
session.flush()
get = Architecture.get(1, session)
assert get
assert get.arch_string == 'arch'
assert get.description == 'description'
def test_Architecture___eq__():
obj = Architecture('arch')
assert obj == 'arch'
assert 'arch' == obj
def test_Architecture___ne__():
obj = Architecture('arch')
assert obj != 'zzzz'
assert 'zzzz' != obj
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
################################################################################
import pytest
from .section import Section
def test_Section(session):
obj = Section('section')
session.add(obj)
session.flush()
get = Section.get(1, session)
assert get
assert get.section == 'section'
def test_Section___eq__():
obj = Section('section')
assert obj == 'section'
assert 'section' == obj
def test_Section___ne__():
obj = Section('section')
assert obj != 'zzzz'
assert 'zzzz' != obj
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册