
import unittest

from cybox.objects.win_mailslot_object import WinMailslot
from cybox.test.objects import ObjectTestCase


class TestWinMailslot(ObjectTestCase, unittest.TestCase):
    object_type = "WindowsMailslotObjectType"
    klass = WinMailslot

    _full_dict = {
        'handle': [
            {
                'name': "First Mailslot Handle",
                'type': "Mailslot",
                'xsi:type': "WindowsHandleObjectType",
            },
            {
                'name': "Second Mailslot Handle",
                'xsi:type': "WindowsHandleObjectType",
            },
        ],
        'max_message_size': 1024,
        'name': "My Mailslot",
        'read_timeout': 2000,
        'security_attributes': "SecAttributes",
        'xsi:type': object_type,
    }


if __name__ == "__main__":
    unittest.main()


import unittest

from cybox.objects.win_mailslot_object import WinMailslot
from cybox.test.objects import ObjectTestCase


class TestWinMailslot(ObjectTestCase, unittest.TestCase):
    object_type = "WindowsMailslotObjectType"
    klass = WinMailslot

    _full_dict = {
        'handle': {
            'name': "First Mailslot Handle",
            'type': "Mailslot",
            'xsi:type': "WindowsHandleObjectType",
        },
        'max_message_size': 1024,
        'name': "My Mailslot",
        'read_timeout': 2000,
        'security_attributes': "SecAttributes",
        'xsi:type': object_type,
    }


if __name__ == "__main__":
    unittest.main()

Fix WinMailslot object to only use a single handle rather than a list
Fix WinMailslot object to only use a single handle rather than a list

  
  import unittest
  
  from cybox.objects.win_mailslot_object import WinMailslot
  from cybox.test.objects import ObjectTestCase
  
  
  class TestWinMailslot(ObjectTestCase, unittest.TestCase):
      object_type = "WindowsMailslotObjectType"
      klass = WinMailslot
  
      _full_dict = {
-         'handle': [
+         'handle': {
-             {
-                 'name': "First Mailslot Handle",
+             'name': "First Mailslot Handle",
-                 'type': "Mailslot",
+             'type': "Mailslot",
-                 'xsi:type': "WindowsHandleObjectType",
+             'xsi:type': "WindowsHandleObjectType",
-             },
-             {
-                 'name': "Second Mailslot Handle",
-                 'xsi:type': "WindowsHandleObjectType",
-             },
-         ],
+         },
          'max_message_size': 1024,
          'name': "My Mailslot",
          'read_timeout': 2000,
          'security_attributes': "SecAttributes",
          'xsi:type': object_type,
      }
  
  
  if __name__ == "__main__":
      unittest.main()
  
Fix WinMailslot object to only use a single handle rather than a list
## Code Before:

import unittest

from cybox.objects.win_mailslot_object import WinMailslot
from cybox.test.objects import ObjectTestCase


class TestWinMailslot(ObjectTestCase, unittest.TestCase):
    object_type = "WindowsMailslotObjectType"
    klass = WinMailslot

    _full_dict = {
        'handle': [
            {
                'name': "First Mailslot Handle",
                'type': "Mailslot",
                'xsi:type': "WindowsHandleObjectType",
            },
            {
                'name': "Second Mailslot Handle",
                'xsi:type': "WindowsHandleObjectType",
            },
        ],
        'max_message_size': 1024,
        'name': "My Mailslot",
        'read_timeout': 2000,
        'security_attributes': "SecAttributes",
        'xsi:type': object_type,
    }


if __name__ == "__main__":
    unittest.main()

## Instruction:
Fix WinMailslot object to only use a single handle rather than a list
## Code After:

import unittest

from cybox.objects.win_mailslot_object import WinMailslot
from cybox.test.objects import ObjectTestCase


class TestWinMailslot(ObjectTestCase, unittest.TestCase):
    object_type = "WindowsMailslotObjectType"
    klass = WinMailslot

    _full_dict = {
        'handle': {
            'name': "First Mailslot Handle",
            'type': "Mailslot",
            'xsi:type': "WindowsHandleObjectType",
        },
        'max_message_size': 1024,
        'name': "My Mailslot",
        'read_timeout': 2000,
        'security_attributes': "SecAttributes",
        'xsi:type': object_type,
    }


if __name__ == "__main__":
    unittest.main()
