Example #1
0
 def test_remove_talk(self):
     """Test removing a talk"""
     args = shlex.split("talk remove -i 1")
     sys.argv[1:] = args
     cli.parse_args(self.parser, args)
     talks = QtSql.QSqlQuery('SELECT COUNT(*) FROM presentations WHERE title="test title 1" AND speaker="test speaker"')
     self.assertEqual(talks.value(0).toInt()[0], 0)
Example #2
0
 def test_clear_talks(self):
     """Test clearing all talks"""
     args = shlex.split("talk clear")
     sys.argv[1:] = args
     cli.parse_args(self.parser, args)
     count = QtSql.QSqlQuery('SELECT COUNT(*) FROM presentations')
     self.assertEqual(count.value(0).toInt()[0], 0)
Example #3
0
 def test_clear_talks(self):
     """Test clearing all talks"""
     args = shlex.split("talk clear")
     sys.argv[1:] = args
     cli.parse_args(self.parser, args)
     count = QtSql.QSqlQuery('SELECT COUNT(*) FROM presentations')
     self.assertEqual(count.value(0).toInt()[0], 0)
Example #4
0
 def test_remove_talk(self):
     """Test removing a talk"""
     args = shlex.split("talk remove -i 1")
     sys.argv[1:] = args
     cli.parse_args(self.parser, args)
     talks = QtSql.QSqlQuery(
         'SELECT COUNT(*) FROM presentations WHERE title="test title 1" AND speaker="test speaker"'
     )
     self.assertEqual(talks.value(0).toInt()[0], 0)
Example #5
0
def main():
    """Main method for Freeseer

    This is also necessary for entry_point > console_scripts to be able to
    generate the console scripts for Freeseer (setup.py).
    """
    from freeseer.frontend import cli

    parser = cli.setup_parser()
    cli.parse_args(parser)
Example #6
0
def main():
    """Main method for Freeseer

    This is also necessary for entry_point > console_scripts to be able to
    generate the console scripts for Freeseer (setup.py).
    """
    from freeseer.frontend import cli

    parser = cli.setup_parser()
    cli.parse_args(parser)
Example #7
0
    def test_add_talk(self, mock_profile):
        """Test adding a talk"""
        mock_profile.return_value = self.db
        args = shlex.split('talk add -t "test title" -s "john doe" -e testing -r rm123')
        sys.argv[1:] = args
        cli.parse_args(self.parser, args)
        talks = self.db.get_talks()
        talks.next()  # Point to talk data
        talks.next()  # Skip default blank entry
        talks.next()  # Skip first test entry
        talks.next()  # Skip second test entry
        record = talks.record()

        self.assertEqual(talks.value(record.indexOf('title')).toString(), u'test title')
        self.assertEqual(talks.value(record.indexOf('speaker')).toString(), u'john doe')
        self.assertEqual(talks.value(record.indexOf('event')).toString(), u'testing')
        self.assertEqual(talks.value(record.indexOf('room')).toString(), u'rm123')
Example #8
0
    def test_add_talk(self, mock_profile):
        """Test adding a talk"""
        mock_profile.return_value = self.db
        args = shlex.split(
            'talk add -t "test title" -s "john doe" -e testing -r rm123')
        sys.argv[1:] = args
        cli.parse_args(self.parser, args)
        talks = self.db.get_talks()
        talks.next()  # Point to talk data
        talks.next()  # Skip default blank entry
        talks.next()  # Skip first test entry
        talks.next()  # Skip second test entry
        record = talks.record()

        self.assertEqual(
            talks.value(record.indexOf('title')).toString(), u'test title')
        self.assertEqual(
            talks.value(record.indexOf('speaker')).toString(), u'john doe')
        self.assertEqual(
            talks.value(record.indexOf('event')).toString(), u'testing')
        self.assertEqual(
            talks.value(record.indexOf('room')).toString(), u'rm123')
Example #9
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# freeseer - vga/presentation capture software
#
#  Copyright (C) 2013  Free and Open Source Software Learning Centre
#  http://fosslc.org
#
#  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 3 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, see <http://www.gnu.org/licenses/>.

# For support, questions, suggestions or any other inquiries, visit:
# http://wiki.github.com/Freeseer/freeseer/

from freeseer.frontend import cli

parser = cli.setup_parser()
cli.parse_args(parser)