File: testsession.py

package info (click to toggle)
gedit-plugins 48.1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 9,084 kB
  • sloc: python: 2,730; ansic: 2,549; xml: 199; makefile: 11
file content (40 lines) | stat: -rw-r--r-- 1,370 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 Jordi Mas i Hernandez <jmas@softcatala.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 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
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser 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 unittest
from store.session import Session

class TestSession(unittest.TestCase):

    def test_add_file(self):
        session = Session("session_A")
        session.add_file('file')
        self.assertEqual(1, len(session.files))

    def test_compare_objects(self):
        session_a = Session("session_A")
        session_b = Session("session_B")
        self.assertTrue(session_a < session_b)
        self.assertTrue(session_b > session_a)
        self.assertTrue(session_a != session_b)


if __name__ == '__main__':
    unittest.main()