Beispiel #1
0
    def test_UserSchedule(self):

        ical = IcalMap(self.u)
        self.assertEquals(3, len(ical.cal.subcomponents))
        schd = ical.getSchedule()
        self.assertEquals(3, schd.count("mikes awesome project"))
        self.assertEquals(0, schd.count("Pauls horrible project"))
Beispiel #2
0
    def test_GBTSchedule(self):

        ical = IcalMap()
        self.assertEquals(7, len(ical.cal.subcomponents))
        schd = ical.getSchedule()
        self.assertEquals(3, schd.count("mikes awesome project"))
        self.assertEquals(4, schd.count("Pauls horrible project"))
        
        # unschedule one of them
        self.ps[0].state = Period_State.get_state('P')
        self.ps[0].save()

        ical = IcalMap()
        self.assertEquals(6, len(ical.cal.subcomponents))
        schd = ical.getSchedule()
        self.assertEquals(2, schd.count("mikes awesome project"))
        self.assertEquals(4, schd.count("Pauls horrible project"))
Beispiel #3
0
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# 
# Correspondence concerning GBT software should be addressed as follows:
#       GBT Operations
#       National Radio Astronomy Observatory
#       P. O. Box 2
#       Green Bank, WV 24944-0002 USA

from django.core.management import setup_environ
import settings
setup_environ(settings)

from tools.reports.CompletionReport import GenerateReport
from tools.IcalMap import IcalMap
from datetime import datetime, timedelta
import sys

if __name__=='__main__':
    
    days = int(sys.argv[1])
    name = sys.argv[2]

    start = datetime.now()
    end   = start + timedelta(days = days)

    # right now, this output is not being captured
    GenerateReport(end)
    ic = IcalMap()
    ic.writeSchedule(name + ".ics")