Esempio n. 1
0
    def test_limits(self):
        request = self.mock_request()

        rlimits.set_rlimits(request, {"RSS": 1024})

        self.assertEqual(request.rLimits[api.LSF_RLIMIT_RSS], 1024)

        for i, v in enumerate(request.rLimits):
            if i != api.LSF_RLIMIT_RSS:
                self.assertEqual(v, api.DEFAULT_RLIMIT)
Esempio n. 2
0
    def test_limits(self):
        request = self.mock_request()

        rlimits.set_rlimits(request, {'RSS': 1024})

        self.assertEqual(request.rLimits[api.LSF_RLIMIT_RSS], 1024)

        for i, v in enumerate(request.rLimits):
            if i != api.LSF_RLIMIT_RSS:
                self.assertEqual(v, api.DEFAULT_RLIMIT)
Esempio n. 3
0
    def test_invalid_rlimits(self):
        request = self.mock_request()

        with self.assertRaises(exceptions.InvalidRlimit):
            rlimits.set_rlimits(request, {"invalidRlimit": 1024})
Esempio n. 4
0
    def test_default_rlimits(self):
        request = self.mock_request()
        rlimits.set_rlimits(request, {})

        for v in request.rLimits:
            self.assertEqual(v, api.DEFAULT_RLIMIT)
Esempio n. 5
0
    def test_invalid_rlimits(self):
        request = self.mock_request()

        with self.assertRaises(exceptions.InvalidRlimit):
            rlimits.set_rlimits(request, {'invalidRlimit': 1024})
Esempio n. 6
0
    def test_default_rlimits(self):
        request = self.mock_request()
        rlimits.set_rlimits(request, {})

        for v in request.rLimits:
            self.assertEqual(v, api.DEFAULT_RLIMIT)