Пример #1
0
 def test__Standard_G1(self):
   # no input data, active
   pluginStandard = TransformationPlugin('Standard')
   pluginStandard.setParameters(paramsBase)
   res = pluginStandard.run()
   self.assertTrue(res['OK'])
   self.assertEqual(res['Value'], [])
Пример #2
0
 def test__Standard_G10(self):
   #   # no input data, active
   params = dict(paramsBase)
   params['GroupSize'] = 10L
   pluginStandard = TransformationPlugin('Standard')
   pluginStandard.setParameters(params)
   res = pluginStandard.run()
   self.assertTrue(res['OK'])
   self.assertEqual(res['Value'], [])
Пример #3
0
 def test__Standard_Data_G1(self):
   # input data, active
   pluginStandard = TransformationPlugin('Standard')
   pluginStandard.setParameters(paramsBase)
   pluginStandard.setInputData(data)
   res = pluginStandard.run()
   self.assertTrue(res['OK'])
   sortedData = sorted([(",".join(SEs), [lfn]) for lfn, SEs in data.iteritems()])
   self.assertEqual(res['Value'], sortedData)
Пример #4
0
 def test__Standard_Flush_G1(self):
   # input data, flush
   pluginStandard = TransformationPlugin('Standard')
   params = dict(paramsBase)
   params['Status'] = 'Flush'
   pluginStandard.setParameters(params)
   pluginStandard.setInputData(data)
   res = pluginStandard.run()
   sortedData = sorted([(",".join(SEs), [lfn]) for lfn, SEs in data.iteritems()])
   self.assert_(res['OK'])
   self.assertEqual(res['Value'], sortedData)
Пример #5
0
 def test__Standard_Flush_G1( self ):
   # input data, flush
   pluginStandard = TransformationPlugin( 'Standard' )
   params = dict( paramsBase )
   params['Status'] = 'Flush'
   pluginStandard.setParameters( params )
   pluginStandard.setInputData( data )
   res = pluginStandard.run()
   sortedData = sorted([ (",".join(SEs), [lfn]) for lfn,SEs in data.iteritems() ])
   self.assert_( res['OK'] )
   self.assertEqual( res['Value'], sortedData )
Пример #6
0
def test__Standard_Data_G10(setup):
    """Test StandardPlugin: input data, active."""
    params = dict(paramsBase)
    params['GroupSize'] = 10
    pluginStandard = TransformationPlugin('Standard')
    pluginStandard.setParameters(params)
    pluginStandard.setInputData(data)
    res = pluginStandard.run()
    assert res['OK']
    # data less than 10
    assert res['Value'] == []
Пример #7
0
def test__Standard_Flush_G1(setup):
    """Test StandardPlugin: input data, flush."""
    pluginStandard = TransformationPlugin("Standard")
    params = dict(paramsBase)
    params["Status"] = "Flush"
    pluginStandard.setParameters(params)
    pluginStandard.setInputData(data)
    res = pluginStandard.run()
    sortedData = sorted([(",".join(SEs), [lfn]) for lfn, SEs in data.items()])
    assert res["OK"]
    assert sorted(res["Value"]) == sorted(sortedData)
Пример #8
0
def test__Standard_Flush_G1(setup):
    """Test StandardPlugin: input data, flush."""
    pluginStandard = TransformationPlugin('Standard')
    params = dict(paramsBase)
    params['Status'] = 'Flush'
    pluginStandard.setParameters(params)
    pluginStandard.setInputData(data)
    res = pluginStandard.run()
    sortedData = sorted([(",".join(SEs), [lfn])
                         for lfn, SEs in data.iteritems()])
    assert res['OK']
    assert res['Value'] == sortedData
Пример #9
0
def test__Broadcast_Active_G10(setup):
    """Test BroadcastPlugin: input data, Active"""
    thePlugin = TransformationPlugin("Broadcast")
    params = dict(paramsBase)
    params["Status"] = "Active"
    params["SourceSE"] = "['SE1']"
    params["TargetSE"] = ["SE2"]
    params["GroupSize"] = 10
    thePlugin.setParameters(params)
    thePlugin.setInputData(data)
    res = thePlugin.run()
    assert res["OK"]
    assert res["Value"] == []
Пример #10
0
def test__Broadcast_Active_G10(setup):
    """Test BroadcastPlugin: input data, Active"""
    thePlugin = TransformationPlugin('Broadcast')
    params = dict(paramsBase)
    params['Status'] = 'Active'
    params['SourceSE'] = "['SE1']"
    params['TargetSE'] = ['SE2']
    params['GroupSize'] = 10
    thePlugin.setParameters(params)
    thePlugin.setInputData(data)
    res = thePlugin.run()
    assert res['OK']
    assert res['Value'] == []
Пример #11
0
    def test__Standard(self):
        # no input data, active
        pluginStandard = TransformationPlugin('Standard')
        pluginStandard.setParameters(paramsBase)
        res = pluginStandard.run()
        self.assert_(res['OK'])
        self.assertEqual(res['Value'], [])

        # input data, active
        pluginStandard = TransformationPlugin('Standard')
        pluginStandard.setParameters(paramsBase)
        pluginStandard.setInputData(data)
        res = pluginStandard.run()
        self.assert_(res['OK'])
        self.assertEqual(res['Value'], [])

        # input data, flush
        pluginStandard = TransformationPlugin('Standard')
        paramsBase['Status'] = 'Flush'
        pluginStandard.setParameters(paramsBase)
        pluginStandard.setInputData(data)
        res = pluginStandard.run()
        self.assert_(res['OK'])
        self.assertNotEqual(res['Value'], [])
Пример #12
0
  def test__Standard( self ):
    # no input data, active
    pluginStandard = TransformationPlugin( 'Standard' )
    pluginStandard.setParameters( paramsBase )
    res = pluginStandard.run()
    self.assert_( res['OK'] )
    self.assertEqual( res['Value'], [] )

    # input data, active
    pluginStandard = TransformationPlugin( 'Standard' )
    pluginStandard.setParameters( paramsBase )
    pluginStandard.setInputData( data )
    res = pluginStandard.run()
    self.assert_( res['OK'] )
    self.assertEqual( res['Value'], [] )

    # input data, flush
    pluginStandard = TransformationPlugin( 'Standard' )
    paramsBase['Status'] = 'Flush'
    pluginStandard.setParameters( paramsBase )
    pluginStandard.setInputData( data )
    res = pluginStandard.run()
    self.assert_( res['OK'] )
    self.assertNotEqual( res['Value'], [] )
Пример #13
0
 def test__Standard_Flush_G10(self):
     # input data, flush
     pluginStandard = TransformationPlugin('Standard')
     params = dict(paramsBase)
     params['GroupSize'] = 10L
     params['Status'] = 'Flush'
     pluginStandard.setParameters(params)
     pluginStandard.setInputData(data)
     res = pluginStandard.run()
     sortedData = [('SE1', [
         '/this/is/also/at.12', '/this/is/at.1', '/this/is/at_123',
         '/this/is/at.12'
     ]), ('SE2', ['/this/is/als/at.2', '/this/is/at_23', '/this/is/at.2']),
                   ('SE4', ['/this/is/at_4'])]
     self.assert_(res['OK'])
     self.assertEqual(res['Value'], sortedData)
Пример #14
0
def test__Standard_Flush_G10(setup):
    """Test StandardPlugin: input data, flush."""
    pluginStandard = TransformationPlugin('Standard')
    params = dict(paramsBase)
    params['GroupSize'] = 10
    params['Status'] = 'Flush'
    pluginStandard.setParameters(params)
    pluginStandard.setInputData(data)
    res = pluginStandard.run()
    sortedData = [('SE1', {'/this/is/at.1'}),
                  ('SE1,SE2', {'/this/is/also/at.12', '/this/is/at.12'}),
                  ('SE1,SE2,SE3', {'/this/is/at_123'}),
                  ('SE2', {'/this/is/als/at.2', '/this/is/at.2'}),
                  ('SE2,SE3', {'/this/is/at_23'}), ('SE4', {'/this/is/at_4'})]
    assert res['OK']
    assert [(a, set(b)) for a, b in res['Value']] == sortedData
Пример #15
0
def test__Broadcast_Active_G1_NoSource(setup):
    """Test BroadcastPlugin: input data, Active, noSource"""
    thePlugin = TransformationPlugin("Broadcast")
    params = dict(paramsBase)
    params["Status"] = "Active"
    params["TargetSE"] = ["SE2"]
    params["GroupSize"] = 1
    thePlugin.setParameters(params)
    thePlugin.setInputData(data)
    res = thePlugin.run()
    # sort returned values by first lfn in LFNs
    sortedReturn = [(SE, lfns) for SE, lfns in sorted(res["Value"], key=lambda t: t[1][0])]
    # sort data by lfn
    expected = [("SE2", [lfn]) for lfn, _SEs in sorted(data.items(), key=lambda t: t[0])]
    assert res["OK"]
    assert sortedReturn == expected
Пример #16
0
 def test__Standard_Flush_G10(self):
   # input data, flush
   pluginStandard = TransformationPlugin('Standard')
   params = dict(paramsBase)
   params['GroupSize'] = 10L
   params['Status'] = 'Flush'
   pluginStandard.setParameters(params)
   pluginStandard.setInputData(data)
   res = pluginStandard.run()
   sortedData = [('SE1', ['/this/is/at.1']),
                 ('SE1,SE2', ['/this/is/also/at.12', '/this/is/at.12']),
                 ('SE1,SE2,SE3', ['/this/is/at_123']),
                 ('SE2', ['/this/is/als/at.2', '/this/is/at.2']),
                 ('SE2,SE3', ['/this/is/at_23']),
                 ('SE4', ['/this/is/at_4'])]
   self.assertTrue(res['OK'])
   self.assertEqual(res['Value'], sortedData)
Пример #17
0
def test__Broadcast_Active_G1_NoSource(setup):
    """Test BroadcastPlugin: input data, Active, noSource"""
    thePlugin = TransformationPlugin('Broadcast')
    params = dict(paramsBase)
    params['Status'] = 'Active'
    params['TargetSE'] = ['SE2']
    params['GroupSize'] = 1
    thePlugin.setParameters(params)
    thePlugin.setInputData(data)
    res = thePlugin.run()
    # sort returned values by first lfn in LFNs
    sortedReturn = [
        (SE, lfns) for SE, lfns in sorted(res['Value'], key=lambda t: t[1][0])
    ]
    # sort data by lfn
    expected = [('SE2', [lfn])
                for lfn, _SEs in sorted(data.items(), key=lambda t: t[0])]
    assert res['OK']
    assert sortedReturn == expected
Пример #18
0
def test__Standard_Flush_G10(setup):
    """Test StandardPlugin: input data, flush."""
    pluginStandard = TransformationPlugin("Standard")
    params = dict(paramsBase)
    params["GroupSize"] = 10
    params["Status"] = "Flush"
    pluginStandard.setParameters(params)
    pluginStandard.setInputData(data)
    res = pluginStandard.run()
    sortedData = [
        ("SE1", {"/this/is/at.1"}),
        ("SE1,SE2", {"/this/is/also/at.12", "/this/is/at.12"}),
        ("SE1,SE2,SE3", {"/this/is/at_123"}),
        ("SE2", {"/this/is/als/at.2", "/this/is/at.2"}),
        ("SE2,SE3", {"/this/is/at_23"}),
        ("SE4", {"/this/is/at_4"}),
    ]
    assert res["OK"]
    assert [(a, set(b)) for a, b in res["Value"]] == sortedData