|
| 1 | +#!/usr/bin/python |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | + |
| 4 | +# freeseer - vga/presentation capture software |
| 5 | +# |
| 6 | +# Copyright (C) 2014 Free and Open Source Software Learning Centre |
| 7 | +# http://fosslc.org |
| 8 | +# |
| 9 | +# This program is free software: you can redistribute it and/or modify |
| 10 | +# it under the terms of the GNU General Public License as published by |
| 11 | +# the Free Software Foundation, either version 3 of the License, or |
| 12 | +# (at your option) any later version. |
| 13 | +# |
| 14 | +# This program is distributed in the hope that it will be useful, |
| 15 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | +# GNU General Public License for more details. |
| 18 | +# |
| 19 | +# You should have received a copy of the GNU General Public License |
| 20 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | + |
| 22 | +# For support, questions, suggestions or any other inquiries, visit: |
| 23 | +# http://wiki.github.com/Freeseer/freeseer/ |
| 24 | + |
| 25 | +import pytest |
| 26 | +from PyQt4 import QtCore |
| 27 | + |
| 28 | +from freeseer.framework.config.profile import Profile |
| 29 | +from freeseer.framework.presentation import Presentation |
| 30 | + |
| 31 | + |
| 32 | +@pytest.fixture |
| 33 | +def db(tmpdir): |
| 34 | + """Return a new empty QtDBConnector""" |
| 35 | + profile = Profile(str(tmpdir), 'testing') |
| 36 | + return profile.get_database() |
| 37 | + |
| 38 | + |
| 39 | +@pytest.fixture |
| 40 | +def fake_presentation(): |
| 41 | + """Returns a presentation object with fake data. Also demonstrates how to construct time values for presentations""" |
| 42 | + today = QtCore.QDate().currentDate() # today |
| 43 | + # TODO: The currentDateTime object sets milliseconds. Convert it back to a string then to a QDateTime object again |
| 44 | + # to get rid of milliseconds. There has got to be a better solution... |
| 45 | + current_time = QtCore.QDateTime.fromString(QtCore.QDateTime().currentDateTime().toString()) # yyyy-mm-ddThh:mm:ss |
| 46 | + return Presentation( |
| 47 | + title='MITM presentation attacks', |
| 48 | + speaker='Alice and Eve', |
| 49 | + description='Field survey of current MITM presentation attacks.', |
| 50 | + category='Security category', |
| 51 | + event='testing event', |
| 52 | + room='1300', |
| 53 | + date=today, |
| 54 | + startTime=current_time.addSecs(60 * 5), |
| 55 | + endTime=current_time.addSecs(60 * 10) |
| 56 | + ) |
| 57 | + |
| 58 | + |
| 59 | +@pytest.fixture |
| 60 | +def presentation_sc2010(): |
| 61 | + """Presentation object from the Summercamp2010 rss feed.""" |
| 62 | + return Presentation( |
| 63 | + title='Managing map data in a database', |
| 64 | + speaker='Andrew Ross', |
| 65 | + description='''This talk will provide a brief introduction to geospatial technologies. It will focus on ''' |
| 66 | + '''managing map data with a relational database. Managing map data with a database provides the atomicity, ''' |
| 67 | + '''security, access that is difficult to achieve otherwise. It also provides powerful techniques for querying''' |
| 68 | + ''' spatial aware data which can enable new insights.''', |
| 69 | + category='Intermediate', |
| 70 | + event='Summercamp2010', |
| 71 | + room='Rom AB113', |
| 72 | + date=QtCore.QDate.fromString('2010-05-14T10:45', QtCore.Qt.ISODate), |
| 73 | + startTime=QtCore.QDateTime.fromString('2010-05-14T10:45', 'yyyy-MM-ddThh:mm') |
| 74 | + ) |
| 75 | + |
| 76 | + |
| 77 | +@pytest.fixture |
| 78 | +def presentation_sc2011_maxwell_rss(): |
| 79 | + """Creates a presentation from the summercamp2011 csv file""" |
| 80 | + return Presentation( |
| 81 | + title='Building NetBSD', |
| 82 | + speaker='David Maxwell', |
| 83 | + description='''People who are interested in learning about operating systems have a lot of topics to absorb,''' |
| 84 | + ''' but the very first barrier that gets in people's way is that you need to be able to build the software. ''' |
| 85 | + '''If you can't build it, you can't make changes. If building it is painful, you'll find other things to do ''' |
| 86 | + '''with your time.\n''' |
| 87 | + '''\tThe NetBSD Project has a build system that goes far beyond what many other projects implement. Come to ''' |
| 88 | + '''this talk about learn about\n''' |
| 89 | + '''\tbuild.sh and the features available that make multi-architecture and embedded development environments ''' |
| 90 | + '''a breeze with NetBSD.\n''' |
| 91 | + '''\tNetBSD website: http://www.NetBSD.org/''', |
| 92 | + event='SC2011', |
| 93 | + category='Beginner', |
| 94 | + room='', |
| 95 | + date=QtCore.QDate.fromString('2011-08-17T20:29', QtCore.Qt.ISODate), |
| 96 | + startTime=QtCore.QDateTime.fromString('2011-08-17T20:29', 'yyyy-MM-ddThh:mm') |
| 97 | + ) |
| 98 | + |
| 99 | + |
| 100 | +@pytest.fixture |
| 101 | +def presentation_sc2011_maxwell_csv(): |
| 102 | + """Creates a presentation from the summercamp2011 csv file""" |
| 103 | + return Presentation( |
| 104 | + title='Building NetBSD', |
| 105 | + speaker='David Maxwell', |
| 106 | + description='''People who are interested in learning about operating systems have a lot of topics to absorb,''' |
| 107 | + ''' but the very first barrier that gets in people's way is that you need to be able to build the software. ''' |
| 108 | + '''If you can't build it, you can't make changes. If building it is painful, you'll find other things to do ''' |
| 109 | + '''with your time.\n''' |
| 110 | + '''\tThe NetBSD Project has a build system that goes far beyond what many other projects implement. Come to ''' |
| 111 | + '''this talk about learn about\n''' |
| 112 | + '''\tbuild.sh and the features available that make multi-architecture and embedded development environments ''' |
| 113 | + '''a breeze with NetBSD.\n''' |
| 114 | + '''\tNetBSD website: http://www.NetBSD.org/''', |
| 115 | + event='SC2011', |
| 116 | + category='Beginner', |
| 117 | + room='None', |
| 118 | + date=QtCore.QDate.fromString('2011-08-17T20:29', QtCore.Qt.ISODate), |
| 119 | + startTime=QtCore.QDateTime.fromString('2011-08-17T20:29', 'yyyy-MM-ddThh:mm').time().toString('hh:mm ap') |
| 120 | + ) |
| 121 | + |
| 122 | + |
| 123 | +@pytest.fixture |
| 124 | +def presentation_sc2011_dixon(): |
| 125 | + """Presentation from the Summercamp2011 csv file""" |
| 126 | + return Presentation( |
| 127 | + title='Lecture Broadcast and Capture using BigBlueButton', |
| 128 | + speaker='Fred Dixon', |
| 129 | + description='''BigBlueButton is an open source web conferencing system for distance education. It's goal is ''' |
| 130 | + '''to enable remote students to have a high-quality learning experience. The #1 requested feature we've had ''' |
| 131 | + '''over the last year is to integrate record and playback of a session.\n''' |
| 132 | + '''\n''' |
| 133 | + '''\t\n''' |
| 134 | + '''\tFred Dixon and Richard Alam, two of the BigBlueButton committers, will describe the architecture and ''' |
| 135 | + '''implementation of record and playback as well as demonstrate the integration with Moodle to show how an ''' |
| 136 | + '''educational institution can use BigBlueButton to setup virtual classrooms, record lectures, and provide ''' |
| 137 | + '''students access to the recorded content from within the Moodle interface.\n''' |
| 138 | + '''\n''' |
| 139 | + '''\tWe will also demonstrate an prototype integration with popcorn.js (Mozilla project) using it as a ''' |
| 140 | + '''playback client for the recorded content.''', |
| 141 | + event='SC2011', |
| 142 | + category='Intermediate', |
| 143 | + room='', |
| 144 | + date='', |
| 145 | + startTime='' |
| 146 | + ) |
0 commit comments