1
# Copyright 2014 Microsoft Corporation
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
7
# http://www.apache.org/licenses/LICENSE-2.0
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
15
# Requires Python 2.4+ and Openssl 1.0+
17
# Implements parts of RFC 2131, 1541, 1497 and
18
# http://msdn.microsoft.com/en-us/library/cc227282%28PROT.10%29.aspx
19
# http://msdn.microsoft.com/en-us/library/cc227259%28PROT.13%29.aspx
22
import tests.tools as tools
27
import azurelinuxagent.protocol.v1 as v1
28
from azurelinuxagent.future import text
30
VersionInfoSample=u"""\
31
<?xml version="1.0" encoding="utf-8"?>
34
<Version>2012-11-30</Version>
37
<Version>2010-12-15</Version>
38
<Version>2010-28-10</Version>
43
class TestVersionInfo(unittest.TestCase):
44
def test_version_info(self):
45
config = v1.VersionInfo(VersionInfoSample)
46
self.assertEquals("2012-11-30", config.get_preferred())
47
self.assertNotEquals(None, config.get_supported())
48
self.assertEquals(2, len(config.get_supported()))
49
self.assertEquals("2010-12-15", config.get_supported()[0])
50
self.assertEquals("2010-28-10", config.get_supported()[1])
52
if __name__ == '__main__':